This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FRAME_CHAIN() -> frame_id_unwind() ?


Hello,

This, I think, is the missing piece in making the frame code fully recursive.

A frame ID provides a frame unique identifer. It includes the frame's stack address (for all stacks, the IA64 has two stacks) and the frame's code pointer. A frame ID can be used for things like find a dummy-frame's data, or find the selected frame after a frame cache flush.

By asking the next frame to unwind the frame ID we get that unique identifier. FRAME_CHAIN() only returns the frame pointer on the main stack so it, in the long run, isn't going to be sufficient.

Initially, for old code, frame_id_unwind() method would look something like:

frame_id.base = FRAME_CHAIN() or FRAME_FP()
frame_id.pc = FRAME_SAVED_PC(); /* aka frame_pc_unwind() */

And for a dummy-frame, it would be even simpler:

// prev_id saved when dummy frame was created
return dummy_frame->prev_id;

The CFI code could be implemented to do something equivalent.

This will give us:

frame_register_unwind()
frame_pc_unwind()
frame_id_unwind()

Thoughts, at least on the principle?

Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]