Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Use the frame address in block to locate alpha mdebug records
@ 2008-11-24 18:05 Jerome Guitton
  2008-11-24 18:35 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Jerome Guitton @ 2008-11-24 18:05 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1193 bytes --]

Hello,

In alpha-mdebug-tdep.c, the frame address in block is used to locate
the mdebug information associated to a function... except for one
occurence, in alpha_mdebug_frame_unwind_cache, where the return
address is used. I fail to understand why, and it seems wrong to me:
the return address may point to the "next" function in .text, so we
may end up fetching the wrong debug record. This typically happens with
no-return functions that do not have epilogue sequences.

This patch should fix this. This also fixes Ada's "catch exception"
feature on alpha-tru64; the procedures that raise exceptions in the
Ada run-time are no-return, which is why they are affected by the
problem I mentionned.

I failed to run the dejaGNU testsuite on an alpha machine, too many
hangups.  However, I have been validated this patch against AdaCore's
internal testsuite and I had no regression. I am pretty confident that
it will not break anything.

OK to apply?
Thanks,
Jerome


2008-11-24  Jerome Guitton  <guitton@adacore.com>

	* alpha-mdebug-tdep.c (alpha_mdebug_frame_unwind_cache): Use
        the frame address in block instead of the return address to
        locate the mdebug PDR of the frame.


[-- Attachment #2: alpha-mdebug-tdep.c.diff --]
[-- Type: text/x-diff, Size: 694 bytes --]

Index: alpha-mdebug-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/alpha-mdebug-tdep.c,v
retrieving revision 1.21
diff -u -p -r1.21 alpha-mdebug-tdep.c
--- alpha-mdebug-tdep.c	21 May 2008 14:47:26 -0000	1.21
+++ alpha-mdebug-tdep.c	24 Nov 2008 11:55:55 -0000
@@ -193,7 +193,7 @@ alpha_mdebug_frame_unwind_cache (struct 
 
   info = FRAME_OBSTACK_ZALLOC (struct alpha_mdebug_unwind_cache);
   *this_prologue_cache = info;
-  pc = get_frame_pc (this_frame);
+  pc = get_frame_address_in_block (this_frame);
 
   /* ??? We don't seem to be able to cache the lookup of the PDR
      from alpha_mdebug_frame_p.  It'd be nice if we could change

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-11-24 13:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-24 18:05 [RFA] Use the frame address in block to locate alpha mdebug records Jerome Guitton
2008-11-24 18:35 ` Daniel Jacobowitz
2008-11-24 18:51   ` Jerome Guitton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox