From e886a1732a221f36ae53d7c46383ffcaba865fdc Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Thu, 2 Feb 2012 18:04:29 +0000 Subject: gdbserver/ 2012-02-02 Pedro Alves * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current inferior. gdb/ 2012-02-02 Pedro Alves * remote.c (remote_get_min_fast_tracepoint_insn_len): Return 0 if the current inferior has no execution. Make sure the current remote process matches gdb's current inferior. --- gdb/ChangeLog | 6 ++++++ gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/tracepoint.c | 7 +++++++ gdb/remote.c | 8 ++++++++ 4 files changed, 26 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 211af59..62ef750 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2012-02-02 Pedro Alves + + * remote.c (remote_get_min_fast_tracepoint_insn_len): Return 0 if + the current inferior has no execution. Make sure the current + remote process matches gdb's current inferior. + 2012-02-02 Tom Tromey PR gdb/13405: diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 0aa5a83..cdc8448 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2012-02-02 Pedro Alves + + * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current + inferior. + 2012-01-27 Pedro Alves * linux-low.c (linux_child_pid_to_exec_file): Delete. diff --git a/gdb/gdbserver/tracepoint.c b/gdb/gdbserver/tracepoint.c index 3dc0073..5c565fe 100644 --- a/gdb/gdbserver/tracepoint.c +++ b/gdb/gdbserver/tracepoint.c @@ -3729,6 +3729,13 @@ cmd_qtstmat (char *packet) static void cmd_qtminftpilen (char *packet) { + if (current_inferior == NULL) + { + /* Indicate that the minimum length is currently unknown. */ + strcpy (packet, "0"); + return; + } + sprintf (packet, "%x", target_get_min_fast_tracepoint_insn_len ()); } diff --git a/gdb/remote.c b/gdb/remote.c index 1153980..1c37b69 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -10592,6 +10592,14 @@ remote_get_min_fast_tracepoint_insn_len (void) struct remote_state *rs = get_remote_state (); char *reply; + /* If we're not debugging a process yet, the IPA can't be + loaded. */ + if (!target_has_execution) + return 0; + + /* Make sure the remote is pointing at the right process. */ + set_general_process (); + sprintf (rs->buf, "qTMinFTPILen"); putpkt (rs->buf); reply = remote_get_noisy_reply (&target_buf, &target_buf_size); -- cgit v1.1