This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
New frame migration path ...
- From: Andrew Cagney <ac131313 at redhat dot com>
- To: gdb at sources dot redhat dot com
- Date: Wed, 12 Mar 2003 15:37:22 -0500
- Subject: New frame migration path ...
Below is a sketch for migrating existing ISA's to the new frame unwind code.
(ok, this is a bit light on details :-().
- if you have get_saved_register(this), replace it with
deprecated_unwind_register(this->next) (don't worry, I'm going to also
deprecate get_saved_register).
I'm about to send out a patch that adds a new architecture method -
deprecated_unwind_register() that, while largely equivalent to the old
get_saved_register(), is paramterized with the next, instead of this, frame.
The problem is that the new code relies on being able to do calls like:
frame_register_unwind (next);
... value of register in this, uncreated, frame ...
and that has no equivalent using get_saved_register() vis:
get_saved_register (next->prev)
... value of register in this, uncreated frame ...
(er, hold on next->prev == NULL). MichaelL's fix to x86-64 dummy-id has
this problem - while the patch looks correct, it can't work without the
above!
Given that, for the most part, architecture specific
get_saved_register() functions look like:
frame = get_next_frame(frame);
... find value to unwind ....
e.g., sh, and more importantly cfi. The migration should be `straight
forward' ...
It's deprecated since it is definitly only an intermediate step.
- implement gdbarch_unwind_pc(), delete frame_saved_pc()
This will likely require further fixes to the register unwinder et.al.
It needs to correctly unwind the PC.
- delete POP_FRAME.
Again, could involve fixing the register unwind code.
- implement gdbarch_unwind_dummy_id()
- slowly implement custom unwinders
Thoughts?
Anyone interested in trying it?
Andrew