diff options
author | Vladimir Prus <vladimir@codesourcery.com> | 2010-03-23 22:01:47 +0000 |
---|---|---|
committer | Vladimir Prus <vladimir@codesourcery.com> | 2010-03-23 22:01:47 +0000 |
commit | f197e0f1b1c70895aae1395b96d780379ec695ab (patch) | |
tree | d311581ba37d0b40fa82e8abce8cd2a28a1b8359 /gdb/remote.c | |
parent | 40e1c229a2dd402eb050b1025c4b1b7667a7e83e (diff) | |
download | gdb-f197e0f1b1c70895aae1395b96d780379ec695ab.zip gdb-f197e0f1b1c70895aae1395b96d780379ec695ab.tar.gz gdb-f197e0f1b1c70895aae1395b96d780379ec695ab.tar.bz2 |
Implement -trace-find.
* mi/mi-cmds.c (mi_cmds): Register -trace-find.
* mi/mi-cmds.h (mi_cmd_trace_find): Declare.
* mi/mi-main.c (mi_cmd_trace_find): New.
* target.h (struct target_ops): Document to_trace_find.
* tracepoint.h (tfind_1): Declare.
* tracepoint.c (finish_tfind_command): Rename to...
(tfind_1): ...this.
* remote.c (remote_trace_find): Return -1 if target say
there's no frame. Improve error diagnostics.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index d26f9a5..d041288 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -9533,12 +9533,18 @@ remote_trace_find (enum trace_find_type type, int num, switch (*reply) { case 'F': - if ((target_frameno = (int) strtol (++reply, &reply, 16)) == -1) - error (_("Target failed to find requested trace frame.")); + p = ++reply; + target_frameno = (int) strtol (p, &reply, 16); + if (reply == p) + error (_("Unable to parse trace frame number")); + if (target_frameno == -1) + return -1; break; case 'T': - if ((target_tracept = (int) strtol (++reply, &reply, 16)) == -1) - error (_("Target failed to find requested trace frame.")); + p = ++reply; + target_tracept = (int) strtol (p, &reply, 16); + if (reply == p) + error (_("Unable to parse tracepoint number")); break; case 'O': /* "OK"? */ if (reply[1] == 'K' && reply[2] == '\0') |