public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* Evaluating an expression in a given scope
@ 2005-09-07 12:44 Vladimir Prus
  2005-09-07 13:15 ` Daniel Jacobowitz
  2005-09-07 13:57 ` Daniel Jacobowitz
  0 siblings, 2 replies; 5+ messages in thread
From: Vladimir Prus @ 2005-09-07 12:44 UTC (permalink / raw)
  To: gdb


Hello!

Does gdb provides a clean way to evaluate an expression in a given scope
(file:line)? 

Here's the use case: while in file foo.cpp, line 200, user creates a
watchpoint for expression 'g'. He then stops the GUI debugger and restarts
it again. I want to store the watchpoint in some config file and recreate
it again, but to do that I need a way to create watchpoint at specific
scope. If I just use

   print g
or
   display g

righ away, this might print some other 'g', not the one visible on line 200
of foo.cpp.

I think I can do this with:

    tbreak foo.cpp:100
    jump foo.cpp:100
    display g
    jump <previous source position>

but I have concerns about this being reliable method.

- Volodya


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-09-07 13:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-07 12:44 Evaluating an expression in a given scope Vladimir Prus
2005-09-07 13:15 ` Daniel Jacobowitz
2005-09-07 13:50   ` Vladimir Prus
2005-09-07 13:53     ` Daniel Jacobowitz
2005-09-07 13:57 ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).