Don't overshoot when executing cfa instructions

Andreas Schwab schwab@linux-m68k.org
Sat Jun 27 22:23:00 GMT 2009


The dwarf2 unwinder is careful to substract one from pc when finding the
associated fde, but when executing the cfa instructions it uses the
original pc as the limit, which may cause it to execute too much, for
example if this is a frame calling a noreturn function.  Tested on
powerpc-linux.

Andreas.

2009-06-28  Andreas Schwab  <schwab@linux-m68k.org>

	* dwarf2-frame.c (execute_cfa_program): Use
	get_frame_address_in_block instead of get_frame_pc.

--- gdb/dwarf2-frame.c.~1.89.~	2009-06-25 00:05:03.000000000 +0200
+++ gdb/dwarf2-frame.c	2009-06-27 21:52:17.000000000 +0200
@@ -376,7 +376,7 @@ execute_cfa_program (struct dwarf2_fde *
 		     struct dwarf2_frame_state *fs)
 {
   int eh_frame_p = fde->eh_frame_p;
-  CORE_ADDR pc = get_frame_pc (this_frame);
+  CORE_ADDR pc = get_frame_address_in_block (this_frame);
   int bytes_read;
   struct gdbarch *gdbarch = get_frame_arch (this_frame);
 

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."



More information about the Gdb-patches mailing list