rfc: merge create_new_frame() and get_prev_frame()
Andrew Cagney
ac131313@cygnus.com
Tue Apr 9 09:12:00 GMT 2002
Hello,
(How to clean this up has been bugging me for a long long time).
At present GDB has two functions for creating a frame:
frame1 = get_prev_frame (frame1);
and
create_new_frame (read_fp (), read_pc ())
The functions are implement using a convoluted list of architecture
methods and no one has been clear on how they really do/should work.
I've known that the latter, create_new_frame, was going to need an
overhaul - instead of read_fp() and read_pc() as parameters it should
take the entire bank of hardware registers. Thus create_new_frame()
would be replaced with:
new_frame (registers)
(`registers' ~= read_register_gen())
I think I've finally figured out what to do with get_prev_frame().
I think in essence, get_prev_frame() is just a wrapper around
``new_frame()'' that is:
get_prev_frame(frame)
{
if (frame->prev == NULL)
new_frame (frame->registers)
else
frame->prev
}
(frame->registers ~= get_saved_register (frame), it is recursive).
This is because, in all cases, the frame is created using the registers
and the stop address of the current function.
I'll look to change-request this in a few days.
thoughts?
Andrew
More information about the Gdb
mailing list