Re: [Nemiver-list] Viewing Global/Static Variables



On 8/31/07, A. Gordon <agordon88 domain hid> wrote:
> 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,

Hi,
This is another one of those things that really needs to be
implemented, so thanks for offering to jump in and get started on it.
You also seem to have a pretty good handle on what needs to be
implemented to acheive this right now, I'm impressed.  However, you
should know something before you start working on it.  Right now the
handling of variables in nemiver is a little bit messy and
inconsistent.  Because of this, Dodji has started work on a new
"variable model" at the debugger level.
I don't know exactly what the status of this work is, but it might be
worth waiting for it before starting to implement too much
variable-related functionality.  I haven't been directly involved in
the variables model stuff, so hopefully Dodji will add his thoughts in
when he gets some time (this is becoming a common refrain isn't it?)
:)

-- 
jonner




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