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]

[PATCH] Readjust returned pc in find_pc_sect_line


I found this by code inspection, so I don't have a test case: when
find_pc_sect_line didn't find a useful line info and notcurrent was set it
returns a pc value that is off by one.  I think the adjustment to pc
should be undone before returning it.

Andreas.

2007-04-18  Andreas Schwab  <schwab@suse.de>

	* symtab.c (find_pc_sect_line): Undo adjustment on pc before
	returning it.

--- gdb/symtab.c.~1.157.~	2007-04-16 17:39:04.000000000 +0200
+++ gdb/symtab.c	2007-04-18 14:10:52.000000000 +0200
@@ -2252,6 +2252,9 @@ find_pc_sect_line (CORE_ADDR pc, struct 
 	best_end = item->pc;
     }
 
+  if (notcurrent)
+    pc++;
+
   if (!best_symtab)
     {
       /* If we didn't find any line number info, just return zeros.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


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