[patch]: Fix regression about addr2line for x86/x86_64 pe-coff

Kai Tietz ktietz70@googlemail.com
Fri Oct 5 13:02:00 GMT 2012


Hello,

this patch fixes a regression introduced by patch of Teresa Johnson
from the 24th July this year.  As pe-coff doesn't provide the a cof
specific _find_nearest_line_discriminator implementation the generic
code is called, which simply fails completely.

Regression tested for x86_64-w64-mingw32, i686-w64-mingw32, and
i686-pc-cygwin.  Ok for apply?

Regards,
Kai

2012-10-05  Kai Tietz

	
	* coff-i386.c (_bfd_generic_find_nearest_line_discriminator):
	define as coff_find_nearest_line_discriminator.
	* libcoff-in.h (coff_find_nearest_line_discriminator): New
	* libcoff.h: Regenerated.
	* coff-x86_64.c: Likewise.
	* coffgen.c (coff_find_nearest_line_discriminator): New function.
	prototype.


Index: bfd/coff-x86_64.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-x86_64.c,v
retrieving revision 1.15
diff -u -p -r1.15 coff-x86_64.c
--- bfd/coff-x86_64.c	16 Jan 2012 08:30:18 -0000	1.15
+++ bfd/coff-x86_64.c	1 Oct 2012 14:54:24 -0000
@@ -607,6 +607,9 @@ coff_i386_is_local_label_name (bfd *abfd

 #include "coffcode.h"

+#define _bfd_generic_find_nearest_line_discriminator \
+	coff_find_nearest_line_discriminator
+
 const bfd_target
 #ifdef TARGET_SYM
   TARGET_SYM =
Index: bfd/coff-i386.c
===================================================================
RCS file: /cvs/src/src/bfd/coff-i386.c,v
retrieving revision 1.37
diff -u -p -r1.37 coff-i386.c
--- bfd/coff-i386.c	13 Jul 2012 14:22:43 -0000	1.37
+++ bfd/coff-i386.c	1 Oct 2012 14:54:24 -0000
@@ -607,6 +607,9 @@ coff_i386_is_local_label_name (bfd *abfd

 #include "coffcode.h"

+#define _bfd_generic_find_nearest_line_discriminator \
+	coff_find_nearest_line_discriminator
+
 const bfd_target
 #ifdef TARGET_SYM
   TARGET_SYM =
Index: bfd/coffgen.c
===================================================================
RCS file: /cvs/src/src/bfd/coffgen.c,v
retrieving revision 1.84
diff -u -p -r1.84 coffgen.c
--- bfd/coffgen.c	24 Jul 2012 21:06:57 -0000	1.84
+++ bfd/coffgen.c	1 Oct 2012 14:54:25 -0000
@@ -2349,6 +2419,24 @@ coff_find_nearest_line (bfd *abfd,
 }

 bfd_boolean
+coff_find_nearest_line_discriminator (bfd *abfd,
+				      asection *section,
+				      asymbol **symbols,
+				      bfd_vma offset,
+				      const char **filename_ptr,
+				      const char **functionname_ptr,
+				      unsigned int *line_ptr,
+				      unsigned int *discriminator)
+{
+  *discriminator = 0;
+  return coff_find_nearest_line_with_names (abfd, dwarf_debug_sections,
+                                            section, symbols, offset,
+                                            filename_ptr, functionname_ptr,
+                                            line_ptr);
+}
+
+
+bfd_boolean
 coff_find_inliner_info (bfd *abfd,
 			const char **filename_ptr,
 			const char **functionname_ptr,
Index: bfd/libcoff-in.h
===================================================================
RCS file: /cvs/src/src/bfd/libcoff-in.h,v
retrieving revision 1.46
diff -u -p -r1.46 libcoff-in.h
--- bfd/libcoff-in.h	2 Nov 2011 14:53:04 -0000	1.46
+++ bfd/libcoff-in.h	1 Oct 2012 14:54:26 -0000
@@ -350,6 +371,9 @@ extern asymbol *coff_bfd_make_debug_symb
 extern bfd_boolean coff_find_nearest_line
   (bfd *, asection *, asymbol **, bfd_vma, const char **,
    const char **, unsigned int *);
+extern bfd_boolean coff_find_nearest_line_discriminator
+  (bfd *, asection *, asymbol **, bfd_vma, const char **,
+   const char **, unsigned int *, unsigned int *);
 struct dwarf_debug_section;
 extern bfd_boolean coff_find_nearest_line_with_names
   (bfd *, const struct dwarf_debug_section *, asection *, asymbol **,



More information about the Binutils mailing list