This is the mail archive of the gdb@sources.redhat.com 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: How to set a watch to a point in the source?


Arjan van Dijk <a.vandijk@phys.uu.nl> writes:
> Can someone tell me please if and how I can instruct gdb to do the following?
> I want to add a certain variable to the display list by specifying its
> position in the source code.

GDB doesn't keep any information about the location of a variable's
declaration --- that I can find, anyway.  I think you're out of luck.

What GDB can do, however, is find the definition in scope at a
particular source line.  If you could parse out the variable name from
the source, and then look up that name in the context of that source
line, then you could get the right variable.  I don't know of any
existing interface for doing that; so you'd need to hack on GDB either
way.

(Am I missing some MI capability or something?  I'd love to be wrong.)


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