Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: nickrob@snap.net.nz (Nick Roberts)
To: "Marc Khouzam" <marc.khouzam@ericsson.com>
Cc: <gdb-patches@sourceware.org>
Subject: RE: [Patch] [MI] Out-of-scope varObjects no longer trigger a var-update change
Date: Sat, 02 May 2009 23:09:00 -0000	[thread overview]
Message-ID: <18940.53928.936676.982399@totara.tehura.co.nz> (raw)
In-Reply-To: <6D19CA8D71C89C43A057926FE0D4ADAA075CB185@ecamlmw720.eamcs.ericsson.se>

Marc Khouzam writes:
 > Below is the session.  The testcase is part of my Eclipse
 > regression testsuite and basically looks for the content
 > of a variable name the same thing as a previous variable,
 > which is part of a method named the same thing as where the
 > previous variable was.  You'll understand better from the code
 > below :-)

OK, I see this now.  The failure occurs because `public' is considered
an unchangeable field by GDB.

 > Note that the below passes after I applied my proposed patch.

As a general principle, if a regression occurs I try to remove some of the
added logic, rather than add to it, as I find the latter tends to make
the logic more convoluted.

The procedure, varobj_update, used to return a scalar that corresponded to the
status field of the structure. varobj_update_result.  I don't know what the
advantage of returning a vector of structures is but, in any case, the changed
field of varobj_update_result appears not to be used outside varobj_update.  I
would suggest a change something like below.  A full patch would remove the
changed field altogether.

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


*** varobj.c	25 Apr 2009 13:04:27 +1200	1.127
--- varobj.c	03 May 2009 03:27:17 +1200	
*************** VEC(varobj_update_result) *varobj_update
*** 1182,1198 ****
        r.varobj = *varp;
  
        r.type_changed = type_changed;
-       if (install_new_value ((*varp), new, type_changed))
- 	r.changed = 1;
-       
-       if (new == NULL)
- 	r.status = VAROBJ_NOT_IN_SCOPE;
  
!       if (r.type_changed || r.changed)
  	VEC_safe_push (varobj_update_result, result, &r);
  
!       if (r.status == VAROBJ_NOT_IN_SCOPE)
! 	return result;
      }
  
    VEC_safe_push (varobj_p, stack, *varp);
--- 1182,1204 ----
        r.varobj = *varp;
  
        r.type_changed = type_changed;
  
!       if (r.type_changed)
  	VEC_safe_push (varobj_update_result, result, &r);
  
!       if (install_new_value ((*varp), new, type_changed))
! 	{
! 	  /* If type_changed is 1, install_new_value will never return
! 	     non-zero, so we'll never report the same variable twice.  */
! 	  gdb_assert (!type_changed);
! 	  VEC_safe_push (varobj_update_result, result, &r);
! 	}
!       
!       if (new == NULL)
! 	{
! 	  r.status = VAROBJ_NOT_IN_SCOPE;
! 	  return result;
! 	}
      }
  
    VEC_safe_push (varobj_p, stack, *varp);


  reply	other threads:[~2009-05-02 23:09 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-28 20:04 Marc Khouzam
2009-05-01 12:00 ` Nick Roberts
2009-05-01 13:53   ` Marc Khouzam
2009-05-02 23:09     ` Nick Roberts [this message]
2009-05-04 17:26       ` Marc Khouzam
2009-05-05 11:20         ` Nick Roberts
2009-05-04 17:54       ` Vladimir Prus
2009-05-04 17:56         ` Marc Khouzam
2009-05-07 19:28 ` Marc Khouzam
2009-05-17  7:14 ` Vladimir Prus
2009-05-20 14:32   ` Marc Khouzam

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=18940.53928.936676.982399@totara.tehura.co.nz \
    --to=nickrob@snap.net.nz \
    --cc=gdb-patches@sourceware.org \
    --cc=marc.khouzam@ericsson.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