2013-02-15 Pedro Alves <pedro@codesourcery.com>
Hafiz Abid Qadeer <abidh@codesourcery.com> gdb/ * NEWS: Mention new field "trace-file". * tracepoint.c (trace_status_mi): Output "trace-file" field. (tfile_open): Record the trace file's filename in the trace status. (tfile_files_info): Mention the name of the trace file. Check the "filename" field explicitely. (trace_status_command): Explicitely check "filename" field. (trace_find_command): Ditto. (trace_find_pc_command): Ditto. (trace_find_tracepoint_command): Ditto. (trace_find_line_command): Ditto. (trace_find_range_command): Ditto. (trace_find_outside_command): Ditto. * tracepoint.h (struct trace_status) <from_file>: Rename it to "filename" and make it hold the trace file's filename instead of a boolean. * remote.c (remote_get_trace_status): Initialize "filename" field with NULL instead of 0. gdb/doc/ * gdb.texinfo (GDB/MI Tracepoint Commands) <-trace-status>: Document the "trace-file" field. gdb/testsuite/ * gdb.trace/tfile.exp: Add test for -trace-status command.
This commit is contained in:
parent
ea33f2818e
commit
f5911ea119
9 changed files with 69 additions and 17 deletions
|
@ -1,3 +1,25 @@
|
||||||
|
2013-02-15 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
Hafiz Abid Qadeer <abidh@codesourcery.com>
|
||||||
|
|
||||||
|
* NEWS: Mention new field "trace-file".
|
||||||
|
* tracepoint.c (trace_status_mi): Output "trace-file" field.
|
||||||
|
(tfile_open): Record the trace file's filename in the trace
|
||||||
|
status.
|
||||||
|
(tfile_files_info): Mention the name of the trace file.
|
||||||
|
Check the "filename" field explicitely.
|
||||||
|
(trace_status_command): Explicitely check "filename" field.
|
||||||
|
(trace_find_command): Ditto.
|
||||||
|
(trace_find_pc_command): Ditto.
|
||||||
|
(trace_find_tracepoint_command): Ditto.
|
||||||
|
(trace_find_line_command): Ditto.
|
||||||
|
(trace_find_range_command): Ditto.
|
||||||
|
(trace_find_outside_command): Ditto.
|
||||||
|
* tracepoint.h (struct trace_status) <from_file>: Rename it
|
||||||
|
to "filename" and make it hold the trace file's filename
|
||||||
|
instead of a boolean.
|
||||||
|
* remote.c (remote_get_trace_status): Initialize "filename"
|
||||||
|
field with NULL instead of 0.
|
||||||
|
|
||||||
2013-02-15 Yao Qi <yao@codesourcery.com>
|
2013-02-15 Yao Qi <yao@codesourcery.com>
|
||||||
|
|
||||||
* remote.c: Fix a typo.
|
* remote.c: Fix a typo.
|
||||||
|
|
3
gdb/NEWS
3
gdb/NEWS
|
@ -150,6 +150,9 @@ show filename-display
|
||||||
** The response to breakpoint commands and breakpoint async records
|
** The response to breakpoint commands and breakpoint async records
|
||||||
includes an "installed" field containing a boolean state about each
|
includes an "installed" field containing a boolean state about each
|
||||||
non-pending tracepoint location is whether installed on target or not.
|
non-pending tracepoint location is whether installed on target or not.
|
||||||
|
** Output of the "-trace-status" command includes a "trace-file" field
|
||||||
|
containing the name of the trace file being examined. This field is
|
||||||
|
optional, and only present when examining a trace file.
|
||||||
|
|
||||||
* GDB now supports the "mini debuginfo" section, .gnu_debugdata.
|
* GDB now supports the "mini debuginfo" section, .gnu_debugdata.
|
||||||
You must have the LZMA library available when configuring GDB for this
|
You must have the LZMA library available when configuring GDB for this
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
2013-02-15 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
Hafiz Abid Qadeer <abidh@codesourcery.com>
|
||||||
|
|
||||||
|
* gdb.texinfo (GDB/MI Tracepoint Commands) <-trace-status>:
|
||||||
|
Document the "trace-file" field.
|
||||||
|
|
||||||
2013-02-07 Doug Evans <dje@google.com>
|
2013-02-07 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
* gdb.texinfo (Machine Code): Clarify argument to disassemble
|
* gdb.texinfo (Machine Code): Clarify argument to disassemble
|
||||||
|
|
|
@ -32094,6 +32094,10 @@ The value of the disconnected tracing flag. @code{1} means that
|
||||||
tracing will continue after @value{GDBN} disconnects, @code{0} means
|
tracing will continue after @value{GDBN} disconnects, @code{0} means
|
||||||
that the trace run will stop.
|
that the trace run will stop.
|
||||||
|
|
||||||
|
@item trace-file
|
||||||
|
The filename of the trace file being examined. This field is
|
||||||
|
optional, and only present when examining a trace file.
|
||||||
|
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
@subsubheading @value{GDBN} Command
|
@subsubheading @value{GDBN} Command
|
||||||
|
|
|
@ -10701,7 +10701,7 @@ remote_get_trace_status (struct trace_status *ts)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* We're working with a live target. */
|
/* We're working with a live target. */
|
||||||
ts->from_file = 0;
|
ts->filename = NULL;
|
||||||
|
|
||||||
if (*p++ != 'T')
|
if (*p++ != 'T')
|
||||||
error (_("Bogus trace status reply from target: %s"), target_buf);
|
error (_("Bogus trace status reply from target: %s"), target_buf);
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
2013-02-15 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
Hafiz Abid Qadeer <abidh@codesourcery.com>
|
||||||
|
|
||||||
|
* gdb.trace/tfile.exp: Add test for -trace-status command.
|
||||||
|
|
||||||
2013-02-14 Jan Kratochvil <jan.kratochvil@redhat.com>
|
2013-02-14 Jan Kratochvil <jan.kratochvil@redhat.com>
|
||||||
|
|
||||||
* gdb.threads/pthread_cond_wait.c (main): Remove variable ts. Replace
|
* gdb.threads/pthread_cond_wait.c (main): Remove variable ts. Replace
|
||||||
|
|
|
@ -106,3 +106,7 @@ Not looking at any trace frame.*" \
|
||||||
gdb_test \
|
gdb_test \
|
||||||
"interpreter-exec mi \"-target-select tfile basic.tf\"" \
|
"interpreter-exec mi \"-target-select tfile basic.tf\"" \
|
||||||
"\\^connected.*"
|
"\\^connected.*"
|
||||||
|
|
||||||
|
gdb_test "interpreter-exec mi \"-trace-status\"" \
|
||||||
|
"\\^done,supported=\"file\",trace-file=\".*basic.tf\",running=\"0\",stop-reason=\"request\",frames=\"${decimal}\",frames-created=\"${decimal}\",buffer-size=\"${decimal}\",buffer-free=\"${decimal}\",disconnected=\".*\",circular=\".*\",user-name=\"\",notes=\"\",start-time=\".*\",stop-time=\".*\"" \
|
||||||
|
"-trace-status"
|
||||||
|
|
|
@ -1940,7 +1940,7 @@ trace_status_command (char *args, int from_tty)
|
||||||
|
|
||||||
if (status == -1)
|
if (status == -1)
|
||||||
{
|
{
|
||||||
if (ts->from_file)
|
if (ts->filename != NULL)
|
||||||
printf_filtered (_("Using a trace file.\n"));
|
printf_filtered (_("Using a trace file.\n"));
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2100,17 +2100,20 @@ trace_status_mi (int on_stop)
|
||||||
|
|
||||||
status = target_get_trace_status (ts);
|
status = target_get_trace_status (ts);
|
||||||
|
|
||||||
if (status == -1 && !ts->from_file)
|
if (status == -1 && ts->filename == NULL)
|
||||||
{
|
{
|
||||||
ui_out_field_string (uiout, "supported", "0");
|
ui_out_field_string (uiout, "supported", "0");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ts->from_file)
|
if (ts->filename != NULL)
|
||||||
ui_out_field_string (uiout, "supported", "file");
|
ui_out_field_string (uiout, "supported", "file");
|
||||||
else if (!on_stop)
|
else if (!on_stop)
|
||||||
ui_out_field_string (uiout, "supported", "1");
|
ui_out_field_string (uiout, "supported", "1");
|
||||||
|
|
||||||
|
if (ts->filename != NULL)
|
||||||
|
ui_out_field_string (uiout, "trace-file", ts->filename);
|
||||||
|
|
||||||
gdb_assert (ts->running_known);
|
gdb_assert (ts->running_known);
|
||||||
|
|
||||||
if (ts->running)
|
if (ts->running)
|
||||||
|
@ -2399,7 +2402,8 @@ trace_find_command (char *args, int from_tty)
|
||||||
{ /* This should only be called with a numeric argument. */
|
{ /* This should only be called with a numeric argument. */
|
||||||
int frameno = -1;
|
int frameno = -1;
|
||||||
|
|
||||||
if (current_trace_status ()->running && !current_trace_status ()->from_file)
|
if (current_trace_status ()->running
|
||||||
|
&& current_trace_status ()->filename == NULL)
|
||||||
error (_("May not look at trace frames while trace is running."));
|
error (_("May not look at trace frames while trace is running."));
|
||||||
|
|
||||||
if (args == 0 || *args == 0)
|
if (args == 0 || *args == 0)
|
||||||
|
@ -2450,7 +2454,8 @@ trace_find_pc_command (char *args, int from_tty)
|
||||||
{
|
{
|
||||||
CORE_ADDR pc;
|
CORE_ADDR pc;
|
||||||
|
|
||||||
if (current_trace_status ()->running && !current_trace_status ()->from_file)
|
if (current_trace_status ()->running
|
||||||
|
&& current_trace_status ()->filename == NULL)
|
||||||
error (_("May not look at trace frames while trace is running."));
|
error (_("May not look at trace frames while trace is running."));
|
||||||
|
|
||||||
if (args == 0 || *args == 0)
|
if (args == 0 || *args == 0)
|
||||||
|
@ -2468,7 +2473,8 @@ trace_find_tracepoint_command (char *args, int from_tty)
|
||||||
int tdp;
|
int tdp;
|
||||||
struct tracepoint *tp;
|
struct tracepoint *tp;
|
||||||
|
|
||||||
if (current_trace_status ()->running && !current_trace_status ()->from_file)
|
if (current_trace_status ()->running
|
||||||
|
&& current_trace_status ()->filename == NULL)
|
||||||
error (_("May not look at trace frames while trace is running."));
|
error (_("May not look at trace frames while trace is running."));
|
||||||
|
|
||||||
if (args == 0 || *args == 0)
|
if (args == 0 || *args == 0)
|
||||||
|
@ -2507,7 +2513,8 @@ trace_find_line_command (char *args, int from_tty)
|
||||||
struct symtab_and_line sal;
|
struct symtab_and_line sal;
|
||||||
struct cleanup *old_chain;
|
struct cleanup *old_chain;
|
||||||
|
|
||||||
if (current_trace_status ()->running && !current_trace_status ()->from_file)
|
if (current_trace_status ()->running
|
||||||
|
&& current_trace_status ()->filename == NULL)
|
||||||
error (_("May not look at trace frames while trace is running."));
|
error (_("May not look at trace frames while trace is running."));
|
||||||
|
|
||||||
if (args == 0 || *args == 0)
|
if (args == 0 || *args == 0)
|
||||||
|
@ -2572,7 +2579,8 @@ trace_find_range_command (char *args, int from_tty)
|
||||||
static CORE_ADDR start, stop;
|
static CORE_ADDR start, stop;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
if (current_trace_status ()->running && !current_trace_status ()->from_file)
|
if (current_trace_status ()->running
|
||||||
|
&& current_trace_status ()->filename == NULL)
|
||||||
error (_("May not look at trace frames while trace is running."));
|
error (_("May not look at trace frames while trace is running."));
|
||||||
|
|
||||||
if (args == 0 || *args == 0)
|
if (args == 0 || *args == 0)
|
||||||
|
@ -2605,7 +2613,8 @@ trace_find_outside_command (char *args, int from_tty)
|
||||||
CORE_ADDR start, stop;
|
CORE_ADDR start, stop;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
|
|
||||||
if (current_trace_status ()->running && !current_trace_status ()->from_file)
|
if (current_trace_status ()->running
|
||||||
|
&& current_trace_status ()->filename == NULL)
|
||||||
error (_("May not look at trace frames while trace is running."));
|
error (_("May not look at trace frames while trace is running."));
|
||||||
|
|
||||||
if (args == 0 || *args == 0)
|
if (args == 0 || *args == 0)
|
||||||
|
@ -3762,8 +3771,8 @@ tfile_open (char *filename, int from_tty)
|
||||||
|
|
||||||
trace_regblock_size = 0;
|
trace_regblock_size = 0;
|
||||||
ts = current_trace_status ();
|
ts = current_trace_status ();
|
||||||
/* We know we're working with a file. */
|
/* We know we're working with a file. Record its name. */
|
||||||
ts->from_file = 1;
|
ts->filename = trace_filename;
|
||||||
/* Set defaults in case there is no status line. */
|
/* Set defaults in case there is no status line. */
|
||||||
ts->running_known = 0;
|
ts->running_known = 0;
|
||||||
ts->stop_reason = trace_stop_reason_unknown;
|
ts->stop_reason = trace_stop_reason_unknown;
|
||||||
|
@ -4213,8 +4222,7 @@ tfile_close (int quitting)
|
||||||
static void
|
static void
|
||||||
tfile_files_info (struct target_ops *t)
|
tfile_files_info (struct target_ops *t)
|
||||||
{
|
{
|
||||||
/* (it would be useful to mention the name of the file). */
|
printf_filtered ("\t`%s'\n", trace_filename);
|
||||||
printf_filtered ("Looking at a trace file.\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* The trace status for a file is that tracing can never be run. */
|
/* The trace status for a file is that tracing can never be run. */
|
||||||
|
|
|
@ -72,9 +72,9 @@ enum trace_stop_reason
|
||||||
|
|
||||||
struct trace_status
|
struct trace_status
|
||||||
{
|
{
|
||||||
/* This is true if the status is coming from a file rather
|
/* If the status is coming from a file rather than a live target,
|
||||||
than a live target. */
|
this points at the file's filename. Otherwise, this is NULL. */
|
||||||
int from_file;
|
const char *filename;
|
||||||
|
|
||||||
/* This is true if the value of the running field is known. */
|
/* This is true if the value of the running field is known. */
|
||||||
int running_known;
|
int running_known;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue