Evaluating an expression in a given scope

Daniel Jacobowitz drow@false.org
Wed Sep 7 13:15:00 GMT 2005


On Wed, Sep 07, 2005 at 04:39:52PM +0400, Vladimir Prus wrote:
> 
> Hello!
> 
> Does gdb provides a clean way to evaluate an expression in a given scope
> (file:line)? 

No, not really.  File:line doesn't match unambiguously to scope,
either, so it's not clear what the interface should look like... I
think I'd use $pc instead.

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

... eww... I suppose that'd work.

-- 
Daniel Jacobowitz
CodeSourcery, LLC



More information about the Gdb mailing list