* [PATCH] output INCOMING_RETURN_ADDR_RTX in debug info
@ 2007-08-03 15:51 Nathan Froyd
2007-08-05 7:13 ` Eric Botcazou
0 siblings, 1 reply; 3+ messages in thread
From: Nathan Froyd @ 2007-08-03 15:51 UTC (permalink / raw)
To: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 1366 bytes --]
When PR 24444 was fixed, recording the initial location of the return
address in debug info was made dependent on whether DWARF2_UNWIND_INFO
was defined and was true at runtime. On targets where
DWARF2_UNWIND_INFO is defined to 0, this was a change in behavior from
the previous method, which was to output the initial location of the
return address if DWARF2_UNWIND_INFO was simply defined.
The current behaviour is inconvenient for the debugger on platforms
where DWARF2_UNWIND_INFO is 0, but INCOMING_RETURN_ADDR_RTX is defined.
(Since the debugger now has to guess where the return address is,
whereas the compiler could have simply told it.) On such platforms
(e.g. vxworks targets), we already record register saves in the prologue
in the debug info; we might as well record where the return address is
too. The attached patch changes things to record the initial location
of the return address if INCOMING_RETURN_ADDR_RTX is defined.
I don't see a reason to make this information conditional on
DWARF2_UNWIND_INFO--but I am also not a debug info expert.
Clarifications/corrections welcome!
Bootstrapped and tested on i586-wrs-vxworks. OK to commit?
:ADDPATCH dwarf2:
-Nathan
2007-08-03 Nathan Froyd <froydnj@codesourcery.com>
gcc/
* dwarf2out.c (dwarf2out_frame_init): Make saving
INCOMING_RETURN_ADDR_RTX dependent on whether it is defined.
[-- Attachment #2: dwarf2-retaddr.patch --]
[-- Type: text/plain, Size: 555 bytes --]
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c (revision 178052)
+++ gcc/dwarf2out.c (working copy)
@@ -2612,9 +2612,8 @@ dwarf2out_frame_init (void)
/* On entry, the Canonical Frame Address is at SP. */
dwarf2out_def_cfa (NULL, STACK_POINTER_REGNUM, INCOMING_FRAME_SP_OFFSET);
-#ifdef DWARF2_UNWIND_INFO
- if (DWARF2_UNWIND_INFO)
- initial_return_save (INCOMING_RETURN_ADDR_RTX);
+#ifdef INCOMING_RETURN_ADDR_RTX
+ initial_return_save (INCOMING_RETURN_ADDR_RTX);
#endif
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] output INCOMING_RETURN_ADDR_RTX in debug info
2007-08-03 15:51 [PATCH] output INCOMING_RETURN_ADDR_RTX in debug info Nathan Froyd
@ 2007-08-05 7:13 ` Eric Botcazou
2007-08-09 15:25 ` Nathan Froyd
0 siblings, 1 reply; 3+ messages in thread
From: Eric Botcazou @ 2007-08-05 7:13 UTC (permalink / raw)
To: Nathan Froyd, gcc-patches
> I don't see a reason to make this information conditional on
> DWARF2_UNWIND_INFO--but I am also not a debug info expert.
Yes, the condition is now too weak.
> Clarifications/corrections welcome!
See http://gcc.gnu.org/ml/gcc/2007-04/msg00671.html for another solution.
--
Eric Botcazou
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] output INCOMING_RETURN_ADDR_RTX in debug info
2007-08-05 7:13 ` Eric Botcazou
@ 2007-08-09 15:25 ` Nathan Froyd
0 siblings, 0 replies; 3+ messages in thread
From: Nathan Froyd @ 2007-08-09 15:25 UTC (permalink / raw)
To: Eric Botcazou; +Cc: gcc-patches
[-- Attachment #1: Type: text/plain, Size: 547 bytes --]
On Sun, Aug 05, 2007 at 09:13:02AM +0200, Eric Botcazou wrote:
> >Clarifications/corrections welcome!
>
> See http://gcc.gnu.org/ml/gcc/2007-04/msg00671.html for another solution.
This seems to work fine, thanks for the pointer.
(not necessarily directed at Eric) OK to commit?
:ADDPATCH dwarf2:
-Nathan
2007-08-09 Eric Botcazou <ebotcazou@libertysurf.fr>
Nathan Froyd <froydnj@codesourcery.com>
gcc/
* dwarf2out.c (dwarf2out_frame_init): Check for DWARF2_FRAME_INFO
when determining whether to record INCOMING_RETURN_ADDR_RTX.
[-- Attachment #2: dwarf2-retaddr.patch --]
[-- Type: text/plain, Size: 459 bytes --]
Index: gcc/dwarf2out.c
===================================================================
--- gcc/dwarf2out.c (revision 178389)
+++ gcc/dwarf2out.c (working copy)
@@ -2613,7 +2613,7 @@ dwarf2out_frame_init (void)
dwarf2out_def_cfa (NULL, STACK_POINTER_REGNUM, INCOMING_FRAME_SP_OFFSET);
#ifdef DWARF2_UNWIND_INFO
- if (DWARF2_UNWIND_INFO)
+ if (DWARF2_UNWIND_INFO || DWARF2_FRAME_INFO)
initial_return_save (INCOMING_RETURN_ADDR_RTX);
#endif
}
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-09 15:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-03 15:51 [PATCH] output INCOMING_RETURN_ADDR_RTX in debug info Nathan Froyd
2007-08-05 7:13 ` Eric Botcazou
2007-08-09 15:25 ` Nathan Froyd
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).