From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32453 invoked by alias); 31 Jan 2007 21:29:46 -0000 Received: (qmail 32443 invoked by uid 22791); 31 Jan 2007 21:29:45 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 31 Jan 2007 21:29:34 +0000 Received: from kahikatea.snap.net.nz (197.61.255.123.dynamic.snap.net.nz [123.255.61.197]) by viper.snap.net.nz (Postfix) with ESMTP id 0407D3DA0B1; Thu, 1 Feb 2007 10:29:31 +1300 (NZDT) Received: by kahikatea.snap.net.nz (Postfix, from userid 500) id 47F5F4F728; Thu, 1 Feb 2007 10:29:30 +1300 (NZDT) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17857.2617.164646.935952@kahikatea.snap.net.nz> Date: Wed, 31 Jan 2007 21:29:00 -0000 To: Denis PILAT Cc: gdb-patches Subject: Re: [RFC] varobj deletion after the binary has changed In-Reply-To: <45C0B042.9040308@st.com> References: <45B60056.6030704@st.com> <20070123124457.GA1600@nevyn.them.org> <45B63A49.4010609@st.com> <45B8E8A8.9040904@st.com> <17849.12231.246980.478169@kahikatea.snap.net.nz> <20070125232731.GA30178@nevyn.them.org> <45BDEAEC.1050006@st.com> <17854.28971.170898.231523@kahikatea.snap.net.nz> <45C0B042.9040308@st.com> X-Mailer: VM 7.19 under Emacs 22.0.93.5 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-01/txt/msg00627.txt.bz2 > /* sanity check: have we been passed a pointer? */ > if (changelist == NULL) > - return -1; > + return WRONG_PARAM; > > /* Only root variables can be updated... */ > if (!is_root_p (*varp)) > /* Not a root var */ > - return -1; > + return WRONG_PARAM; > + > + if (!(*varp)->root->is_valid) > + return INVALID; OK I hadn't noticed the distinction between WRONG_PARAM and INVALID. I think it would be better to throw an error in the case of WRONG_PARAM, otherwise changes to leaf values may go unnoticed. But this is a separate change. I've not checked the test but I think the English could be improved and different names used: > ... > # Verify that once binary file has changed, GDB correctly handles > # previously defined MI variables. # Verify that once binary file has changed, GDB correctly handles # previously defined MI variable objects. > ... > # > # reload the same binary > # global variable must be keeped, other invalidated # Reload the same binary. # Global variable should remain, local should be invalidated. > # > mi_delete_breakpoints > mi_gdb_load ${binfile_bis} > mi_runto main > # Check local variable are "invalid" # Check local variable is "invalid" > mi_gdb_test "-var-update linteger" \ > "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\"\}\\\]" \ > "linteger not anymore in scope due to binary changes" > > mi_gdb_test "-var-info-type linteger" \ > "\\^done,type=\"\"" \ > "not type for invalid variable linteger" "no type for invalid variable linteger (1)" > # Check global variable are still correct. > mi_gdb_test "-var-update global_simple" \ > "\\^done,changelist=\\\[\]" \ > "global_simple still alive" > > mi_gdb_test "-var-info-type global_simple" \ > "\\^done,type=\"simpleton\"" \ > "type simpleton for valid variable global_simple" > > > # > # load an other binary > # all variables must be invalidated I guess capital letters at the start and full stops. > mi_delete_breakpoints > mi_gdb_load ${binfile2} > # Check local variable are "invalid" > mi_gdb_test "-var-update linteger" \ > "\\^done,changelist=\\\[\{name=\"linteger\",in_scope=\"invalid\"\}\\\]" \ > "linteger not valid anymore due to binary changes" > > mi_gdb_test "-var-info-type linteger" \ > "\\^done,type=\"\"" \ > "not type for invalid variable linteger" "no type for invalid variable linteger (2)" > > # Check global variable are still correct. > mi_gdb_test "-var-update global_simple" \ > "\\^done,changelist=\\\[\{name=\"global_simple\",in_scope=\"invalid\"\}\\\]" \ > "global_simple not anymore in scope due to binary changes" > > mi_gdb_test "-var-info-type global_simple" \ > "\\^done,type=\"\"" \ > "not type for invalid variable global_simple" > "no type for invalid variable global_simple" > mi_gdb_exit > return 0 -- Nick http://www.inet.net.nz/~nickrob