This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
a -1 dummy frame
- From: Andrew Cagney <ac131313 at cygnus dot com>
- To: gdb at sources dot redhat dot com
- Date: Wed, 08 May 2002 11:25:00 -0400
- Subject: a -1 dummy frame
[I'm definitly thinking out loud here. This follows on from previous
attempts at cleaning up the same area Turns out my other theory about
the shape of dinosaurs wasn't original.]
At present GDB creates its inner most frame using the call:
create_frame (read_fp(), read_pc())
where read_fp() and read_pc() refer to the register cache. After that,
frames are created using something like:
frame->frame = frame_chain (next)
frame->pc = frame_prev_pc (next)
I think, instead, things would work better if GDB first created an
initial frame:-1 dummy frame. This frame would map register requests
directly onto the register cache. That way, the inner most frame,
created with:
frame->frame = frame_chain (frame:-1)
frame->pc = frame_prev_pc (frame:-1)
could (in theory) use the same methods as every other frame.
It would also, I think, address the problem of connecting to a target
that has a totally corrupted inner most frame. The -1 frame would still
exist so things could still stumble along - info registers would still
work as it could be called with frame:-1.
There is of course a very very long gap between this theory and current
reality. The above would only work if the frame_chain() and prev_pc()
code only accessed registers from the next frame via a very right
interface (and not use all sorts of other internal knowledge as it
currently does).
Any way, food for thought,
enjoy,
Andrew