This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: SIGSEGV on gdb 6.7*


Daniel Jacobowitz wrote:
On Mon, Feb 04, 2008 at 09:58:42PM +0000, Greg Law wrote:
Should it be just flushregs that invalidates the frame cache, or should it happen from registers_changed()?

Good question :-) Probably registers_changed, but I suspect that makes a lot of other reinit_frame_cache calls redundant.


Well, calling reinit_frame_cache() from registers_changed() does indeed fix the problem. It doesn't seem that a few redundant calls to reinit_frame_cache() is a big issue: if it's already NULL then there isn't much work for that function to do. OTOH, not calling it where it should be called clearly is pretty serious.


The attached patch does this. I guess copyright assignment etc is rather over the top for such a small change, but if you prefer we go through those hoops then I'm happy to do so.

g

--
Greg Law, Undo Software                       http://undo-software.com/
Index: gdb/regcache.c
===================================================================
RCS file: /cvs/src/src/gdb/regcache.c,v
retrieving revision 1.163
diff -u -r1.163 regcache.c
--- gdb/regcache.c	1 Jan 2008 22:53:12 -0000	1.163
+++ gdb/regcache.c	4 Feb 2008 22:24:32 -0000
@@ -472,6 +472,9 @@
   regcache_xfree (current_regcache);
   current_regcache = NULL;
 
+  /* Need to forget about any frames we have cached, too. */
+  reinit_frame_cache ();
+
   /* Force cleanup of any alloca areas if using C alloca instead of
      a builtin alloca.  This particular call is used to clean up
      areas allocated by low level target code which may build up

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]