This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB 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]

Re: [PATCH] Don't set breakpoints on import stubs on Windows amd64


On 18/03/2015 23:26, Pedro Alves wrote:
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 366d828..21e7a77 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -675,7 +675,7 @@ coff_symfile_read (struct objfile *objfile, int symfile_flags)
  	      && (strncmp (name, "__imp_", 6) == 0
  		  || strncmp (name, "_imp_", 5) == 0))
  	    {
-	      const char *name1 = (name[1] == '_' ? &name[7] : &name[6]);
+	      const char *name1 = &name[6];
  	      struct bound_minimal_symbol found;

As is, that would make it look suspiciously like a bug to a casual
reader.  It'd be very good to have a comment here.
But maybe if we rewrite this in terms of bfd_get_symbol_leading_char,
it ends up being "self commenting".  Something like the hunk below.

Yes, that is better, and seems to work fine.


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