gdbserver/
authorPedro Alves <palves@redhat.com>
Thu, 2 Feb 2012 18:04:29 +0000 (18:04 +0000)
committerPedro Alves <palves@redhat.com>
Thu, 2 Feb 2012 18:04:29 +0000 (18:04 +0000)
2012-02-02  Pedro Alves  <palves@redhat.com>

* tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
inferior.

gdb/
2012-02-02  Pedro Alves  <palves@redhat.com>

* 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
gdb/gdbserver/ChangeLog
gdb/gdbserver/tracepoint.c
gdb/remote.c

index 211af5979f9a72c3917763823d3e28c4baa697d6..62ef750656e50634096f476cf3c5ca7b94880340 100644 (file)
@@ -1,3 +1,9 @@
+2012-02-02  Pedro Alves  <palves@redhat.com>
+
+       * 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  <tromey@redhat.com>
 
        PR gdb/13405:
index 0aa5a834f1015594576936cf79ba310a992b627b..cdc8448c7c91c1f21a9f99b27e465a98031d3246 100644 (file)
@@ -1,3 +1,8 @@
+2012-02-02  Pedro Alves  <palves@redhat.com>
+
+       * tracepoint.c (cmd_qtminftpilen): Return 0 if there's no current
+       inferior.
+
 2012-01-27  Pedro Alves  <palves@redhat.com>
 
        * linux-low.c (linux_child_pid_to_exec_file): Delete.
index 3dc00739dc04711defe5b698d5eb794616eea520..5c565fe4c8a47231f84e66a423d2376ac842d568 100644 (file)
@@ -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 ());
 }
 
index 11539806cdf02420208de857d0df63207648276d..1c37b69c22f64f3f2d272635b66841940819662a 100644 (file)
@@ -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);