This is the mail archive of the 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]

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.

- 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.

- 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
   if (target_has_execution && get_current_frame ())
     (get_current_frame ())->pc = read_pc ();



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