Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] module local variable not visible in variables view



cdt-dev-bounces@xxxxxxxxxxx wrote on 11/10/2007 02:53:52 AM:

> I post this here in the hope I am missing something before raising as a bug:
>
> Consider the code (in a single source file)
>
> int first = 1 ;
> static int second = 2 ;
>
> int main(void)
> {
>      int third = 3 ;
>      static int forth = 4 ;
>
> -->[current debug location]
>      ...
> }
>
>
> When debugging, 'third' and 'forth' are visible in the variable view
> and 'first'
> can be visible through 'add global variable'
>
> However, I can't find a way to make 'second' appear in the view. I can add a
> watch and type in the variable name - but this will appear in the _expression_
> window, not the variables window.
>
> Is this (a very annoying) feature, a bug, or am I missing a trick?
>


Try specifying the -gstabs flag. I haven't checked recently, but the MinGW
toolset had problems debugging statics and class member variables unless
this flag was specified.

> On a related note, it appears that the list of global variable is
> not obtained
> by querying gdb (symbol-list-variables). How are the global
> variables obtained?
> I ask, because in the above example, gdb returns 'second' when queried.
>
> Thanks,
>
> --
> Derek
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev

Back to the top