Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC] varobj deletion after the binary has changed
@ 2007-01-23 12:32 Denis PILAT
  2007-01-23 12:45 ` Daniel Jacobowitz
  0 siblings, 1 reply; 32+ messages in thread
From: Denis PILAT @ 2007-01-23 12:32 UTC (permalink / raw)
  To: gdb-patches

[-- 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 */

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2007-02-20 16:17 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-23 12:32 [RFC] varobj deletion after the binary has changed Denis PILAT
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox