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

Re: Watchpoint single-stepping.


Hi,

Thanks for your help. What I am trying to do is mimic the way a
software watchpoint works, in that I want to make GDB single-step
through the program and then compare the values of the current
variables to some other values. What suggestions would you have for
implementing this, as I'm not sure how to go about it becasue there is
no documentation in GDB Internals on how single-stepping is done.

On a side note, does GDB maintain a internal model of the control flow
graph of the program being executed.

Thanks for your help.

Rob

On 08/10/06, Frédéric Riss <frederic.riss@gmail.com> wrote:
Le samedi 07 octobre 2006 à 23:55 +0100, Rob Quill a écrit :
> I am trying to find the point in the code where the conditions of a
> software watchpoint are checked each step, as I wish to add something
> that also requires the checking of values of variables at each step.
> Does anyone know where this is?

All the low-level stepping is done in the infrun.c file. Look
particularly at the handle_inferior_event function which is called for
each target stop event. There you'll find calls to bpstat_stop_status
(defined in breakpoint.c) where watchpoint expressions are re-evealuated
and compared to their old value.

Fred.




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