diff options
author | Yao Qi <yao@codesourcery.com> | 2013-06-07 00:19:36 +0000 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2013-06-07 00:19:36 +0000 |
commit | aef525cb15cdf95759c015cf237d6337407aa47a (patch) | |
tree | a2c9fc37b466e36720b24c3e3d786993ba4b89f2 /gdb/tracepoint.c | |
parent | 21d6c799a732f0a8b78d701d9b055508664389f6 (diff) | |
download | gdb-aef525cb15cdf95759c015cf237d6337407aa47a.zip gdb-aef525cb15cdf95759c015cf237d6337407aa47a.tar.gz gdb-aef525cb15cdf95759c015cf237d6337407aa47a.tar.bz2 |
gdb/
* tracepoint.c (start_tracing): Move code to ...
(trace_reset_local_state): ... here. New.
(disconnect_tracing): Don't call set_current_traceframe,
set_tracepoint_num, and set_traceframe_context. Call
trace_reset_local_state instead.
(tfile_close): Call trace_reset_local_state.
* ctf.c (ctf_close): Likewise.
* remote.c (remote_close): Likewise.
* tracepoint.h (trace_reset_local_state): Declare.
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r-- | gdb/tracepoint.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index d6ff051..5bad3e8 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -1700,6 +1700,16 @@ process_tracepoint_on_disconnect (void) " GDB is disconnected\n")); } +/* Reset local state of tracing. */ + +void +trace_reset_local_state (void) +{ + set_traceframe_num (-1); + set_tracepoint_num (-1); + set_traceframe_context (NULL); + clear_traceframe_info (); +} void start_tracing (char *notes) @@ -1822,11 +1832,8 @@ start_tracing (char *notes) target_trace_start (); /* Reset our local state. */ - set_traceframe_num (-1); - set_tracepoint_num (-1); - set_traceframe_context (NULL); + trace_reset_local_state (); current_trace_status()->running = 1; - clear_traceframe_info (); } /* The tstart command requests the target to start a new trace run. @@ -2234,9 +2241,7 @@ disconnect_tracing (void) 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_current_traceframe (-1); - set_tracepoint_num (-1); - set_traceframe_context (NULL); + trace_reset_local_state (); } /* Worker function for the various flavors of the tfind command. */ @@ -4657,6 +4662,8 @@ tfile_close (void) trace_fd = -1; xfree (trace_filename); trace_filename = NULL; + + trace_reset_local_state (); } static void |