binutils-gdb/gdb/mi
Yao Qi cc3da68801 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.
2014-03-06 11:33:06 +08:00
..
ChangeLog-1999-2003
mi-cmd-break.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-cmd-break.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-cmd-catch.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-cmd-disas.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-cmd-env.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-cmd-file.c psymtab cleanup patch 3/3 2014-01-14 18:36:33 -08:00
mi-cmd-info.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-cmd-stack.c Extension Language API 2014-02-05 19:27:58 -08:00
mi-cmd-target.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-cmd-var.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-cmds.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-cmds.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-common.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-common.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-console.c replace XMALLOC with XNEW 2014-01-13 07:31:28 -07:00
mi-console.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-getopt.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-getopt.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-interp.c replace XMALLOC with XNEW 2014-01-13 07:31:28 -07:00
mi-main.c Fix PR16508 2014-03-06 11:33:06 +08:00
mi-main.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-out.c constify ui_out_impl 2014-02-28 08:51:15 -07:00
mi-out.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-parse.c replace XMALLOC with XNEW 2014-01-13 07:31:28 -07:00
mi-parse.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
mi-symbol-cmds.c Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00