This is the mail archive of the binutils-cvs@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[binutils-gdb] Make binutils abort message GDB friendly


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7ac018954bd9c2d964204a451ecabdd7d8a11945

commit 7ac018954bd9c2d964204a451ecabdd7d8a11945
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Jul 17 08:29:26 2015 -0700

    Make binutils abort message GDB friendly
    
    We used to generate abort messages like:
    
    internal error, aborting at .../bfd/elf64-x86-64.c line 1554 in elf_x86_64_check_relocs
    
    We can't cut and paste "file line ???" to GDB.  This patch changes those
    abort messages to
    
    internal error, aborting at .../bfd/elf64-x86-64.c:1554 in elf_x86_64_check_relocs
    
    so that we can cut and paste "file:???" to GDB.
    
    bfd/
    
    	* bfd.c (_bfd_abort): Replace " line " with ":" in output
    	message.
    
    gas/
    
    	* messages.c (as_assert): Replace " line " with ":" in output
    	message.
    	(as_abort): Likewise.
    
    ld/
    
    	* ldmisc.c (ld_abort): Replace " line " with ":" in output
    	message.

Diff:
---
 bfd/bfd.c      | 4 ++--
 gas/messages.c | 8 ++++----
 ld/ldmisc.c    | 4 ++--
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/bfd/bfd.c b/bfd/bfd.c
index 846ab58..c02edbe 100644
--- a/bfd/bfd.c
+++ b/bfd/bfd.c
@@ -1090,11 +1090,11 @@ _bfd_abort (const char *file, int line, const char *fn)
 {
   if (fn != NULL)
     (*_bfd_error_handler)
-      (_("BFD %s internal error, aborting at %s line %d in %s\n"),
+      (_("BFD %s internal error, aborting at %s:%d in %s\n"),
        BFD_VERSION_STRING, file, line, fn);
   else
     (*_bfd_error_handler)
-      (_("BFD %s internal error, aborting at %s line %d\n"),
+      (_("BFD %s internal error, aborting at %s:%d\n"),
        BFD_VERSION_STRING, file, line);
   (*_bfd_error_handler) (_("Please report this bug.\n"));
   _exit (EXIT_FAILURE);
diff --git a/gas/messages.c b/gas/messages.c
index c1743fb..890e908 100644
--- a/gas/messages.c
+++ b/gas/messages.c
@@ -295,10 +295,10 @@ as_assert (const char *file, int line, const char *fn)
   as_show_where ();
   fprintf (stderr, _("Internal error!\n"));
   if (fn)
-    fprintf (stderr, _("Assertion failure in %s at %s line %d.\n"),
+    fprintf (stderr, _("Assertion failure in %s at %s:%d.\n"),
 	     fn, file, line);
   else
-    fprintf (stderr, _("Assertion failure at %s line %d.\n"), file, line);
+    fprintf (stderr, _("Assertion failure at %s:%d.\n"), file, line);
   fprintf (stderr, _("Please report this bug.\n"));
   xexit (EXIT_FAILURE);
 }
@@ -311,10 +311,10 @@ as_abort (const char *file, int line, const char *fn)
 {
   as_show_where ();
   if (fn)
-    fprintf (stderr, _("Internal error, aborting at %s line %d in %s\n"),
+    fprintf (stderr, _("Internal error, aborting at %s:%d in %s\n"),
 	     file, line, fn);
   else
-    fprintf (stderr, _("Internal error, aborting at %s line %d\n"),
+    fprintf (stderr, _("Internal error, aborting at %s:%d\n"),
 	     file, line);
   fprintf (stderr, _("Please report this bug.\n"));
   xexit (EXIT_FAILURE);
diff --git a/ld/ldmisc.c b/ld/ldmisc.c
index 3b0d126..4659921 100644
--- a/ld/ldmisc.c
+++ b/ld/ldmisc.c
@@ -534,10 +534,10 @@ void
 ld_abort (const char *file, int line, const char *fn)
 {
   if (fn != NULL)
-    einfo (_("%P: internal error: aborting at %s line %d in %s\n"),
+    einfo (_("%P: internal error: aborting at %s:%d in %s\n"),
 	   file, line, fn);
   else
-    einfo (_("%P: internal error: aborting at %s line %d\n"),
+    einfo (_("%P: internal error: aborting at %s:%d\n"),
 	   file, line);
   einfo (_("%P%F: please report this bug\n"));
   xexit (1);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]