This is the mail archive of the gdb-prs@sourceware.org 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]

[Bug python/19286] crash when requesting "pc" from pending frame object


https://sourceware.org/bugzilla/show_bug.cgi?id=19286

--- Comment #4 from Pedro Alves <palves at redhat dot com> ---
Turns out it doesn't.

The problem is that pending_framepy_read_register uses get_frame_register_value
which only works for raw registers.  Kevin's working on addressing that, by
using value_of_user_reg.  However, that exposes another recursion problem.  

Reading such a register value produces a lazy lval_register value, and such
registers need to store their frame's id in VALUE_FRAME_ID.  And that then
calls into get_frame_id of the pending frame.  The problem is that in the
Python unwinder API, it's the job of the sniffer hook to return back the
frame's ID to gdb.  Since we're inside the sniffer hook still, there's no way
for GDB to know the frame id yet...  This is a mismatch between the Python
unwinder API
and GDB's internal unwinder APIs...

The solution we're currently attempting is to make VALUE_FRAME_ID store the
frame id of the _next_ frame instead (which would be the sentinel frame in
this case of the current frame), and then adjust value_fetch_lazy to use
frame_unwind_register_value directly on the next frame instead of using
get_frame_register_value.  Similarly for other VALUE_FRAME_ID users.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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