diff options
author | Yao Qi <yao@codesourcery.com> | 2014-02-15 08:48:53 +0800 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2014-03-06 11:33:06 +0800 |
commit | cc3da688013b5fb3dcc1fa5206bbeef4a35cc10c (patch) | |
tree | 8bccdf77f1d2543b5d3c7f658b9e4cf027cacd6c /gdb/mi | |
parent | 6a5f844b29319793deb3840b20803bd3a0fa01a2 (diff) | |
download | fsf-binutils-gdb-cc3da688013b5fb3dcc1fa5206bbeef4a35cc10c.zip fsf-binutils-gdb-cc3da688013b5fb3dcc1fa5206bbeef4a35cc10c.tar.gz fsf-binutils-gdb-cc3da688013b5fb3dcc1fa5206bbeef4a35cc10c.tar.bz2 |
Fix PR16508
This patch fixes PR16508, which is about MI "-trace-find frame-number 0"
behaves differently from CLI "tfind 0". In CLI, we check both
status->running and status->filename, but in MI, we only check
status->running, which looks wrong to me. This patch moves the code
of checking to a new function check_trace_running, and use it in
both CLI and MI.
This patch also adds a test case pr16508.exp, which fails without this
fix, and passes with the fix applied.
FAIL: gdb.trace/pr16508.exp: interpreter-exec mi "-trace-find frame-number 0"
gdb:
2014-03-06 Yao Qi <yao@codesourcery.com>
PR breakpoints/16508
* tracepoint.c (check_trace_running): New function.
(trace_find_command): Move code to check_trace_running and
call check_trace_running.
(trace_find_pc_command): Likewise.
(trace_find_tracepoint_command): Likewise.
(trace_find_line_command): Likewise.
(trace_find_range_command): Likewise.
* tracepoint.h (check_trace_running): Likewise.
* mi/mi-main.c (mi_cmd_trace_find): Call check_trace_running.
gdb/testsuite:
2014-03-06 Yao Qi <yao@codesourcery.com>
* gdb.trace/pr16508.exp: New file.
Diffstat (limited to 'gdb/mi')
-rw-r--r-- | gdb/mi/mi-main.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index 161307a..1598af0 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -2483,8 +2483,7 @@ mi_cmd_trace_find (char *command, char **argv, int argc) return; } - if (current_trace_status ()->running) - error (_("May not look at trace frames while trace is running.")); + check_trace_running (current_trace_status ()); if (strcmp (mode, "frame-number") == 0) { |