This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [rfc] Unwind the ARM CPSR
- From: Joel Brobecker <brobecker at adacore dot com>
- To: gdb-patches at sourceware dot org, Mark Kettenis <kettenis at gnu dot org>, Jim Blandy <jimb at codesourcery dot com>
- Date: Thu, 11 Oct 2007 20:53:36 -0700
- Subject: Re: [rfc] Unwind the ARM CPSR
- References: <20071011145137.GA18336@caradoc.them.org>
> So why shouldn't the argument be the CURRENT (i.e. THIS) frame
> instead? Then we can call frame_register (CURRENT) instead of
> frame_unwind_register (NEXT) to get the same result, plus we'll
> have the option of calling frame_unwind_register (CURRENT) when
> we need it.
I can see why you'd like some feedback. This (amazing piece of) code
has always been a bit difficult for me to grasp in its entirety...
I hope others will take some time to think about it too, because
I don't feel sufficiently proficient to provide a confident answer.
FWIW, I don't see how we could end up breaking something with your
approach. As it turns out, there is a comment that says about
the prev_register method:
Why not pass in THIS_FRAME? By passing in NEXT frame and THIS
cache, the supplied parameters are consistent with the sibling
function THIS_ID.
So it sounds like the author wasn't seeing any issue with that
either.
I personally think that passing the current frame will make
this function a little easier to understand too, no? (I find
the twist of computing the caller's registers of this frame
using the next frame a constant mental exercise)
> Of course this would be a pain to change all at once since there are
> so many unwinders. I'd introduce a new method instead
> (unwind->prev_register_this?). What do you think?
Sounds like a possible plan to me.
--
Joel