Patchwork [review] Silence ARI for valid calls to abort

login
register
mail settings
Submitter Simon Marchi (Code Review)
Date Dec. 5, 2019, 3:44 p.m.
Message ID <gerrit.1575560698000.I09ce6aa5010bbe4e5bb73ffdb727481be39d34d6@gnutoolchain-gerrit.osci.io>
Download mbox | patch
Permalink /patch/36542/
State New
Headers show

Comments

Simon Marchi (Code Review) - Dec. 5, 2019, 3:44 p.m.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/744
......................................................................

Silence ARI for valid calls to abort

There are a handful of spots in gdb that validly call abort.  This
patch adds the appropriate ARI marker to these lines, to silence the
ARI report.

gdb/ChangeLog
2019-12-05  Tom Tromey  <tromey@adacore.com>

	* utils.c (abort_with_message, dump_core, internal_vproblem): Add
	ARI marker to abort.
	* event-top.c (handle_sigsegv): Add ARI marker to abort.

Change-Id: I09ce6aa5010bbe4e5bb73ffdb727481be39d34d6
---
M gdb/ChangeLog
M gdb/event-top.c
M gdb/utils.c
3 files changed, 10 insertions(+), 4 deletions(-)
Simon Marchi (Code Review) - Dec. 5, 2019, 4:49 p.m.
Pedro Alves has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/744
......................................................................


Patch Set 1: Code-Review+2

Ahaha, yeah, I forgot to point at that "only 3 calls" comment in the threads series.  :-)
Simon Marchi (Code Review) - Dec. 12, 2019, 5:21 p.m.
Tom Tromey has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/744
......................................................................


Patch Set 1:

> Patch Set 1: Code-Review+2
> 
> Ahaha, yeah, I forgot to point at that "only 3 calls" comment in the threads series.  :-)

I see now there's a fix() call about this in gdb_ari.sh.
In general I think these fix() calls should be removed in favor
of annotations at the point of call.  I'll comment on that in another
patch as well.
Simon Marchi (Code Review) - Dec. 13, 2019, 2:25 p.m.
Pedro Alves has posted comments on this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/744
......................................................................


Patch Set 2: Code-Review+2

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e0ac58e..36f407f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@ 
 2019-12-05  Tom Tromey  <tromey@adacore.com>
 
+	* utils.c (abort_with_message, dump_core, internal_vproblem): Add
+	ARI marker to abort.
+	* event-top.c (handle_sigsegv): Add ARI marker to abort.
+
+2019-12-05  Tom Tromey  <tromey@adacore.com>
+
 	* contrib/ari/gdb_ari.sh: Fix floatformat_from_double text.
 
 2019-12-05  Tom Tromey  <tromey@adacore.com>
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 9ec599e..5feb292 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -881,7 +881,7 @@ 
   install_handle_sigsegv ();
 
   if (thread_local_segv_handler == nullptr)
-    abort ();
+    abort ();			/* ARI: abort */
   thread_local_segv_handler (sig);
 }
 
diff --git a/gdb/utils.c b/gdb/utils.c
index f7fae35..08be146 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -186,7 +186,7 @@ 
   else
     fputs_unfiltered (msg, gdb_stderr);
 
-  abort ();		/* NOTE: GDB has only three calls to abort().  */
+  abort ();		/* ARI: abort */
 }
 
 /* Dump core trying to increase the core soft limit to hard limit first.  */
@@ -200,7 +200,7 @@ 
   setrlimit (RLIMIT_CORE, &rlim);
 #endif /* HAVE_SETRLIMIT */
 
-  abort ();		/* NOTE: GDB has only three calls to abort().  */
+  abort ();		/* ARI: abort */
 }
 
 /* Check whether GDB will be able to dump core using the dump_core
@@ -320,7 +320,7 @@ 
            does not fix this problem.  This is the solution suggested
            at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25509.  */
 	if (write (STDERR_FILENO, msg, sizeof (msg)) != sizeof (msg))
-          abort (); /* NOTE: GDB has only three calls to abort().  */
+          abort (); /* ARI: abort */
 	exit (1);
       }
   }