From: Denis PILAT <denis.pilat@st.com>
To: gdb-patches <gdb-patches@sourceware.org>
Subject: [RFC] varobj deletion after the binary has changed
Date: Tue, 23 Jan 2007 12:32:00 -0000 [thread overview]
Message-ID: <45B60056.6030704@st.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 456 bytes --]
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
[-- Attachment #2: varobj.patch --]
[-- Type: text/plain, Size: 1881 bytes --]
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 <sys/types.h>
#include <fcntl.h>
@@ -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 */
next reply other threads:[~2007-01-23 12:32 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-23 12:32 Denis PILAT [this message]
2007-01-23 12:45 ` Daniel Jacobowitz
2007-01-23 12:52 ` Vladimir Prus
2007-01-23 14:49 ` Denis PILAT
2007-01-24 21:49 ` Nick Roberts
2007-01-24 22:07 ` Daniel Jacobowitz
2007-01-24 22:08 ` Frédéric Riss
2007-01-24 22:18 ` Nick Roberts
2007-01-24 22:52 ` Frédéric Riss
2007-01-24 23:14 ` Nick Roberts
2007-01-25 2:41 ` Daniel Jacobowitz
2007-01-25 20:50 ` Nick Roberts
2007-01-26 7:25 ` Denis PILAT
2007-01-23 17:20 ` Denis PILAT
2007-01-25 17:28 ` Denis PILAT
2007-01-25 22:31 ` Nick Roberts
2007-01-25 23:27 ` Daniel Jacobowitz
2007-01-29 12:39 ` Denis PILAT
2007-01-29 22:12 ` Nick Roberts
2007-01-30 8:49 ` Denis PILAT
2007-01-31 19:07 ` Denis PILAT
2007-01-31 21:29 ` Nick Roberts
2007-02-01 9:49 ` Denis PILAT
2007-02-08 16:41 ` Daniel Jacobowitz
2007-02-08 19:33 ` Nick Roberts
2007-02-08 19:55 ` Daniel Jacobowitz
2007-02-09 15:43 ` Eli Zaretskii
2007-02-12 21:10 ` Denis PILAT
2007-02-13 0:11 ` Nick Roberts
2007-02-13 8:26 ` Denis PILAT
2007-02-20 16:06 ` Andreas Schwab
2007-02-20 16:17 ` Denis PILAT
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=45B60056.6030704@st.com \
--to=denis.pilat@st.com \
--cc=gdb-patches@sourceware.org \
/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