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?
I was asked, in private e-mail, which arcitecture should be examined in
terms of how to currently implement things: