From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17233 invoked by alias); 23 Jan 2007 12:32:48 -0000 Received: (qmail 17224 invoked by uid 22791); 23 Jan 2007 12:32:47 -0000 X-Spam-Check-By: sourceware.org Received: from vir-del-03.spheriq.net (HELO vir-del-03.spheriq.net) (194.50.41.42) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 23 Jan 2007 12:32:40 +0000 Received: from vir-out-02.spheriq.net ([194.50.41.31]) by vir-del-03.spheriq.net with ESMTP id l0NCWYn4007847 for ; Tue, 23 Jan 2007 12:32:34 GMT Received: from vir-cus-01.spheriq.net (vir-cus-01.spheriq.net [194.50.41.85]) by vir-out-02.spheriq.net with ESMTP id l0NCWYFV021075 for ; Tue, 23 Jan 2007 12:32:34 GMT Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by vir-cus-01.spheriq.net with ESMTP id l0NCWVmT005480 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 23 Jan 2007 12:32:34 GMT Received: from zeta.dmz-eu.st.com (ns2.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8DB9ADA44 for ; Tue, 23 Jan 2007 12:32:31 +0000 (GMT) Received: from mail1.cro.st.com (mail1.cro.st.com [164.129.40.131]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 8F58447560 for ; Tue, 23 Jan 2007 12:32:30 +0000 (GMT) Received: from [164.129.44.95] (crx595.cro.st.com [164.129.44.95]) by mail1.cro.st.com (MOS 3.5.8-GR) with ESMTP id CJM27098 (AUTH "denis pilat"); Tue, 23 Jan 2007 13:32:23 +0100 (CET) Message-ID: <45B60056.6030704@st.com> Date: Tue, 23 Jan 2007 12:32:00 -0000 From: Denis PILAT User-Agent: Thunderbird 1.5.0.9 (X11/20061206) MIME-Version: 1.0 To: gdb-patches Subject: [RFC] varobj deletion after the binary has changed Content-Type: multipart/mixed; boundary="------------080507050103090105010108" 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/msg00469.txt.bz2 This is a multi-part message in MIME format. --------------080507050103090105010108 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 456 Hi, We have a bug in one of our gdb target, when the binary changed while beeing debugged it appears that some of our varobj refers to invalid symbols or type. I propose a patch that delete all varobj when symbols are reloaded. May be there is a better place to do that but I think we must do that somewhere, don't you ? Daniel: There is no regression in the testsuite on linux native target with this patch :) -- Denis Pilat STMicroelectronics --------------080507050103090105010108 Content-Type: text/plain; name="varobj.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="varobj.patch" Content-length: 1881 Index: symfile.c =================================================================== RCS file: /cvs/src/src/gdb/symfile.c,v retrieving revision 1.180 diff -u -p -r1.180 symfile.c --- symfile.c 21 Jan 2007 01:02:03 -0000 1.180 +++ symfile.c 23 Jan 2007 10:00:36 -0000 @@ -52,6 +52,7 @@ #include "observer.h" #include "exec.h" #include "parser-defs.h" +#include "varobj.h" #include #include @@ -2602,6 +2603,10 @@ clear_symtab_users (void) between expressions and which ought to be reset each time. */ expression_context_block = NULL; innermost_block = NULL; + + /* Varobj may refer to symbols, delete all of them. */ + varobj_delete_all (); + } static void Index: varobj.c =================================================================== RCS file: /cvs/src/src/gdb/varobj.c,v retrieving revision 1.79 diff -u -p -r1.79 varobj.c --- varobj.c 16 Jan 2007 02:12:49 -0000 1.79 +++ varobj.c 23 Jan 2007 10:00:46 -0000 @@ -2545,3 +2545,23 @@ When non-zero, varobj debugging is enabl show_varobjdebug, &setlist, &showlist); } + +int +varobj_delete_all (void) +{ + struct varobj **allvarobj; + struct varobj **var; + int nv; + nv = varobj_list (&allvarobj); + if (nv > 0) + { + var = allvarobj; + while (*var != NULL) + { + varobj_delete (*var, NULL, 0); + var++; + } + xfree (allvarobj); + } + return nv; +} Index: varobj.h =================================================================== RCS file: /cvs/src/src/gdb/varobj.h,v retrieving revision 1.7 diff -u -p -r1.7 varobj.h --- varobj.h 9 Jan 2007 17:58:59 -0000 1.7 +++ varobj.h 23 Jan 2007 10:00:46 -0000 @@ -99,4 +99,6 @@ extern int varobj_list (struct varobj ** extern int varobj_update (struct varobj **varp, struct varobj ***changelist); +extern int varobj_delete_all (void); + #endif /* VAROBJ_H */ --------------080507050103090105010108--