Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <ghost@cs.msu.su>
To: gdb-patches@sources.redhat.com
Subject: Re: Language of registers
Date: Mon, 27 Nov 2006 06:32:00 -0000	[thread overview]
Message-ID: <eke0pm$d8s$2@sea.gmane.org> (raw)
In-Reply-To: <17770.13228.627008.188019@kahikatea.snap.net.nz>

Nick Roberts wrote:

> 
>> At the moment, MI varobj assume that register values have a language. As
>> result, if you try to look at values of $xmm1 in a C++ program, you'll
>> find that this registers has a 'public' field -- which is not reasonable.
> 
>> The attached patch causes MI to always force the C language for register
>> values, so no special processing takes place. OK?
> 
> Experimenting with register names as variable objects:
> 
> With C:
> 
>   -var-create - * $xmm1
>   ^done,name="var1",numchild="7",type="builtin_type_vec128i"
>   (gdb)
>   -var-list-children var1
>   &"Attempt to take address of value not located in memory.\n"
>   ^error,msg="Attempt to take address of value not located in memory."
> 
> 
> With C++
> 
>   -var-create - * $xmm1
>   ^done,name="var1",numchild="1",type="builtin_type_vec128i"
>   (gdb)
>   -var-list-children var1
>   Segmentation fault (core dumped)

What gdb is this? Both work fine for me with mainline.

> but there are already MI commands for registers.  Notably
> 
> -data-list-register-values
> 
> and
> 
> -data-list-changed-registers which is a bit like var-update.
> 
> 
> What advantage do variable objects offer for register names?

To begin with -- consistenly. There is no fundamental difference between
ordinary values and registers. The frontend knows how to display the
hierarchy of variable objects, and there's no need to force the frontend to
have additional logic for register. Note that Eclipse, for example, does
create variable objects for all registers at the moment.

The second advantage is that -data-list-register-values has no hierarchy at
all. If you try 

  -data-list-register-values xmm1

then gdb print print half-screen of output that should be specially parsed
and displayed. When using variable objects, the frontend already has the
parsing/display code.

- Volodya






> 
> 



  reply	other threads:[~2006-11-27  6:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-27  0:43 Nick Roberts
2006-11-27  6:32 ` Vladimir Prus [this message]
2006-11-27  7:37   ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2006-12-06 21:54 Nick Roberts
2006-12-06 22:03 ` Daniel Jacobowitz
2006-12-06 22:55   ` Nick Roberts
2006-12-06 23:10     ` Daniel Jacobowitz
2006-11-25 11:22 Vladimir Prus
2006-11-27 14:03 ` Daniel Jacobowitz
2006-11-28 17:12   ` Vladimir Prus
2006-11-28 17:23     ` Daniel Jacobowitz
2006-11-28 18:09       ` Vladimir Prus
2006-12-01 14:32         ` Daniel Jacobowitz
2006-12-01 18:03           ` Jim Ingham
2006-11-29 10:12   ` Vladimir Prus

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='eke0pm$d8s$2@sea.gmane.org' \
    --to=ghost@cs.msu.su \
    --cc=gdb-patches@sources.redhat.com \
    /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