This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Get out of tfind mode when detaching
- From: Stan Shebs <stan at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Fri, 26 Mar 2010 17:24:39 -0700
- Subject: [PATCH] Get out of tfind mode when detaching
Bad Stuff(tm) happens if you happen to detach while in tfind mode. This
patch prevents it. (A more elegant tracepoint design might make it part
of a target's to_detach method; maybe next year. :-) ) Committed to trunk.
Stan
2010-03-26 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (disconnect_or_stop_tracing): Get out of tfind mode.
Index: tracepoint.c
===================================================================
RCS file: /cvs/src/src/gdb/tracepoint.c,v
retrieving revision 1.159
diff -p -r1.159 tracepoint.c
*** tracepoint.c 26 Mar 2010 15:26:29 -0000 1.159
--- tracepoint.c 27 Mar 2010 00:10:36 -0000
*************** disconnect_or_stop_tracing (int from_tty
*** 1745,1750 ****
--- 1745,1757 ----
if (!cont)
stop_tracing ();
}
+
+ /* Also we want to be out of tfind mode, otherwise things can get
+ confusing upon reconnection. Just use these calls instead of
+ full tfind_1 behavior because we're in the middle of detaching,
+ and there's no point to updating current stack frame etc. */
+ set_traceframe_number (-1);
+ set_traceframe_context (NULL);
}
/* Worker function for the various flavors of the tfind command. */