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]

Re: MI: fix base members in references


Daniel Jacobowitz wrote:

> On Wed, Nov 29, 2006 at 03:55:42PM +0300, Vladimir Prus wrote:
>> The attached patch fixed the problem, no regression. I'll write a
>> testcase for it as soon as my previous references patch is reviewed -- I
>> don't want to pile too many testcases in as-yet-uncommitted file.
>> 
>> OK?
> 
> OK, with a changelog entry.

Thanks, attached is the version with changelog entry that I've committed.

>> If this patch is fine, can I also commit it to 6.6 branch? The bug in
>> question is quite problematic for C++ code.
> 
> Sounds fine to me, but check with Joel.

I'll check.

After (and if) this patch is merged to branch, and my other references patch
is checked in, I'll adjust the code to just assert, as discussed.

- Volodya

Index: ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.8008
diff -u -p -r1.8008 ChangeLog
--- ChangeLog	6 Dec 2006 06:51:48 -0000	1.8008
+++ ChangeLog	6 Dec 2006 09:01:09 -0000
@@ -1,3 +1,8 @@
+2006-12-06  Vladimir Prus  <vladimir@codesourcery.com>
+
+	* varobj.c (cplus_value_of_child): When accessing
+	base suboject, don't specially process references.
+	
 2006-12-05  Adam Nemet  <anemet@caviumnetworks.com>
 
 	* MAINTAINERS (Write After Approval): Add myself.
Index: varobj.c
===================================================================
RCS file: /cvs/src/src/gdb/varobj.c,v
retrieving revision 1.62
diff -u -p -r1.62 varobj.c
--- varobj.c	29 Nov 2006 06:41:13 -0000	1.62
+++ varobj.c	6 Dec 2006 09:01:10 -0000
@@ -2428,8 +2428,9 @@ cplus_value_of_child (struct varobj *par
 	    {
 	      struct value *temp = NULL;
 
-	      if (TYPE_CODE (value_type (parent->value)) == TYPE_CODE_PTR
-		  || TYPE_CODE (value_type (parent->value)) == TYPE_CODE_REF)
+	      /* No special processing for references is needed --
+		 value_cast below handles references.  */
+	      if (TYPE_CODE (value_type (parent->value)) == TYPE_CODE_PTR)
 		{
 		  if (!gdb_value_ind (parent->value, &temp))
 		    return NULL;

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