This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: same-name vars from different scopes
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
>> There's no syntax for printing a local variable which is hidden by a
>> more inner definition.
Joel> In that case, I think you have to switch frames (there might be
Joel> a known bug with Ada on that subject).
Actually, I meant nested lexical scopes:
void f () {
int x = something;
{
int x = something_else;
}
}
If you in the inner scope, you can't refer directly to the outer 'x'.
You can see it with "info locals", but you can't use it in an expression.
Tom