This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: [rfc] ``pc'' -> resume_addr?
It gets better ...
> Ok, I think I've figured out how this ``works'':
>
> - target stops
>
> - infrun has an initial look round. If it doesn't think the read_pc() value is interesting, it resumes the target. Thing is, I can't detect any write_pc() for this case - as best as I can tell it resumes the target without adjusting the PC.
Add:
- in looking around, it might create a frame (for PC_IN_CALL_DUMMY())
and that frame's PC won't have been adjusted.
> - Otherwise infrun calls bpstat_stop_status() and that will eventually call:
> write_pc(read_pc()-decr);
> and patch up that PC value. Ulgh!
> - finally the block/frame is created. This calls read_pc() and gets the ``fixed'' pc.
Add:
- since the frame (with a botched PC) may have previously been created,
the top level frame->pc needs to be patched:
/* Make sure that the current_frame's pc is correct. This
is a correction for setting up the frame info before doing
DECR_PC_AFTER_BREAK */
if (target_has_execution && get_current_frame ())
(get_current_frame ())->pc = read_pc ();
:-)
Andrew