scope in nested function
Bill Pursell
bill.pursell@gmail.com
Fri Mar 31 08:19:00 GMT 2006
Jim Blandy wrote:
> On 3/30/06, Bill Pursell <bill.pursell@gmail.com> wrote:
>
>>I'm not sure how to reference a variable in a nested function from gdb.
>>In the gdb session below, there are 2 things I don't understand
>>how to do:
>>
>>1) how do I set a breakpoint in foo? (other than by referencing a line
>> number)
>
>
> Have you tried calling it main::foo?
>
>
>>2) when I'm in foo, how do I reference i?
>
>
> Have you tried calling it main::i?
>
> I'm not sure these will work, but I think they're supposed to.
>
I get the error:
Can't find member of namespace, class, struct, or union named "main::foo"
Same for main::i
More information about the Gdb
mailing list