Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Jason Molenda <jmolenda@apple.com>
To: Nick Roberts <nick@nick.uklinux.net>
Cc: gdb@sources.redhat.com
Subject: Re: MI command -stack-list-locals
Date: Fri, 14 Nov 2003 00:19:00 -0000	[thread overview]
Message-ID: <291E7712-1638-11D8-AA48-000393D457E2@apple.com> (raw)
In-Reply-To: <16298.50534.258926.575817@nick.uklinux.net>

Hi Nick, sorry for the late reply.

On Nov 6, 2003, at 2:04 PM, Nick Roberts wrote:

>  This can be a nuisance
> with large arrays or structures and I would like to extend  
> -stack-list-locals
> to do the following:
>
> 1) Display the name and value for simple data types.
> 2) Display the name and type for complex data types.
>
> e.g with the local variables:
>
>   int i, m[10];
>   struct {
>     int j;
>     int k;
>   } values;
>
> the output for "-stack-list-locals 2", say, would be:
>
> ^done,locals=[{name="i",value="5"},
>               {name="m",type="int [10]"}
>               {name="values",type="struct {...}"}]


We've been handling many of the same issues here at Apple for the past  
few years.  Jim's the real expert in regard to our varobj  
modifications, but here's a quick example that might be helpful for  
your problem.

We've added a "2" version of -stack-list-locals which prints out a lot  
more information, as well as automatically creates varobj's for all of  
the local variables.  On the above example, we output

-stack-list-locals 2

^done,locals=[

varobj={exp="i",value="5",name="var1",numchild="0",type="int",typecode=" 
INT",dynamic_type="",in_scope="true",block_start_addr="0x00001dd0",block 
_end_addr="0x00001e04"},

varobj={exp="m",value="[-1]",name="var2",numchild="10",type="int  
[10]",typecode="ARRAY",dynamic_type="",in_scope="true",block_start_addr= 
"0x00001dd0",block_end_addr="0x00001e04"},

varobj={exp="values",value="{...}",name="var3",numchild="2",type="struct 
   
{...}",typecode="STRUCT",dynamic_type="",in_scope="true",block_start_add 
r="0x00001dd0",block_end_addr="0x00001e04"}

],time={wallclock="0.00179",user="0.01000",system="0.00000",start="10687 
68005.990265",end="1068768005.992059"}

I inserted some newlines to make it more readable; of course it's all  
on one line in the real output.

The type of the variable is in the TYPE field; the TYPECODE field is a  
general description for the IDE -- it is the string representation of  
the TYPE_CODE of the varobj (e.g. PTR, ARRAY, STRUCT, ENUM, INT, FLT,  
etc.) which gives the UI an easy way to tell how it should be  
represented to the user.

IN_SCOPE works correctly with our gdb.

DYNAMIC_TYPE is to represent when a varobj is pointer to a C++ class  
that may point to classes higher up the inheritance tree so the UI can  
keep its display up to date as the type changes.

Oh, and the TIME thing at the end is just a little performance monitor  
deal we use internally when we're hunting for slow-downs between the UI  
and gdb; that doesn't have anything to do with the varobj's.



Jason


  reply	other threads:[~2003-11-14  0:19 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-06 21:11 Nick Roberts
2003-11-14  0:19 ` Jason Molenda [this message]
2003-11-14 23:17   ` Nick Roberts
2003-11-17 20:39     ` Alain Magloire
2003-11-17 21:12       ` Jason Molenda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=291E7712-1638-11D8-AA48-000393D457E2@apple.com \
    --to=jmolenda@apple.com \
    --cc=gdb@sources.redhat.com \
    --cc=nick@nick.uklinux.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox