[Nemiver-list] Viewing Global/Static Variables



Hello,


Currently nemiver lists on local variables and function arguments.

I would like to add code to display global and static variables.


Here's my plan (not coded yet):


There's an "mi" command that's called "-symbol-list-variables" which
should display global and static variables. Unfortunately, it's not
implemented (at least on my GDB, version 6.4.90-debian).


So I'll have to resort to "info variables" gdb command which lists
global and static variables.


1. add "list_global_variables()" to class "GDBEngine", which queue this
command.

2. add "OnGlobalVariablesListedHandler" struct (which will be very
similar to "OnLocalVariablesListedHandler"), to parse the output of
"info variables", and emit signal for each variable.

3. in "LocalVarsInspector" class, add a single call to
"list_global_variables". since global  variables don't appear or
disappear, only one such call is needed (unlike "list_local_variables",
which is called on every "stopped" signal).

4. Every global variable will be queried to it's type and value on every
"stopped" signal.


note: "info variables" lists many global variables, some of which are
internal to glibc and are totally uninteresting. they are also marked
under the title "Non-debugging symbols" so these variables will not be
displayed.



Comments are welcomed,

   Gordon.







[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]