Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: Language of registers
@ 2006-12-06 21:54 Nick Roberts
  2006-12-06 22:03 ` Daniel Jacobowitz
  0 siblings, 1 reply; 15+ messages in thread
From: Nick Roberts @ 2006-12-06 21:54 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb-patches

> > What advantage do variable objects offer for register names?

> To begin with -- consistenly. There is no fundamental difference between
> ordinary values and registers.

Is that true?  Is the logic not simpler for registers?  No need to use
GDB's notion of values, check whether they've been fetched etc.

>                                 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.

What hierarchy are you talking about?  Would a variable object for a register
have children?

> 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. 

I think that's because your syntax is wrong:

-data-list-register-names 33
^done,register-names=["xmm1"]
(gdb)
-data-list-register-values x 33
^done,register-values=[{number="33",value="{v4_float = {0x0, 0x0, 0x0, 0x0}, v2_double = {0x0, 0x0}, v16_int8 = {0x0 <repeats 16 times>}, v8_int16 = {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}, v4_int32 = {0x0, 0x0, 0x0, 0x0}, v2_int64 = {0x0, 0x0}, uint128 = 0x00000000000000000000000000000000}"}]


>                When using variable objects, the frontend already has the
> parsing/display code.

What would your variable object print for xmm1?

-- 
Nick                                           http://www.inet.net.nz/~nickrob


^ permalink raw reply	[flat|nested] 15+ messages in thread
* Re: Language of registers
@ 2006-11-27  0:43 Nick Roberts
  2006-11-27  6:32 ` Vladimir Prus
  0 siblings, 1 reply; 15+ messages in thread
From: Nick Roberts @ 2006-11-27  0:43 UTC (permalink / raw)
  To: Vladimir Prus; +Cc: gdb-patches


> 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)

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?


-- 
Nick                                           http://www.inet.net.nz/~nickrob


^ permalink raw reply	[flat|nested] 15+ messages in thread
* Language of registers
@ 2006-11-25 11:22 Vladimir Prus
  2006-11-27 14:03 ` Daniel Jacobowitz
  0 siblings, 1 reply; 15+ messages in thread
From: Vladimir Prus @ 2006-11-25 11:22 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 439 bytes --]


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?

- Volodya

	* varobj.c (varobj_create): For register values,
	always use C as the language.

[-- Attachment #2: c_registers__gdb_mainline.diff --]
[-- Type: text/x-diff, Size: 794 bytes --]

=== gdb/varobj.c
==================================================================
--- gdb/varobj.c	(/mirrors/gdb_mainline)	(revision 2298)
+++ gdb/varobj.c	(/patches/gdb/c_registers/gdb_mainline)	(revision 2298)
@@ -518,7 +518,15 @@
       var->type = value_type (var->value);
 
       /* Set language info */
-      lang = variable_language (var);
+      if (VALUE_REGNUM (var->value) != -1)
+	/* For register values, we don't want any language
+	   specific processing, so use the less specialized
+	   language.  Otherwise, in C++ programs registers likes
+	   xmm1 will feature 'public' children, that makes no
+	   sense for registers.  */
+	lang = vlang_c;
+      else
+	lang = variable_language (var);
       var->root->lang = languages[lang];
 
       /* Set ourselves as our root */

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-12-06 23:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-06 21:54 Language of registers Nick Roberts
2006-12-06 22:03 ` Daniel Jacobowitz
2006-12-06 22:55   ` Nick Roberts
2006-12-06 23:10     ` Daniel Jacobowitz
  -- strict thread matches above, loose matches on Subject: below --
2006-11-27  0:43 Nick Roberts
2006-11-27  6:32 ` Vladimir Prus
2006-11-27  7:37   ` Eli Zaretskii
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox