This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Language of registers


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.
=== 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 */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]