[OBV] gdbserver: Only write ipa_tdesc_idx if agent is actually loaded.
authorMarcin Kościelnicki <koriakin@0x04.net>
Wed, 2 Mar 2016 16:18:29 +0000 (17:18 +0100)
committerMarcin Kościelnicki <koriakin@0x04.net>
Wed, 2 Mar 2016 16:18:29 +0000 (17:18 +0100)
Fixes rather embarassing gdb.trace regressions.

gdb/gdbserver/ChangeLog:

* tracepoint.c (cmd_qtstart): Only set ipa_tdesc_idx if agent
is actually loaded.

gdb/gdbserver/ChangeLog
gdb/gdbserver/tracepoint.c

index 4c8df3f86d76a5d96de0a90cfb481c75d5a5874e..40150d71c8d30675ba7a177c17e3cf6642010bd6 100644 (file)
@@ -1,3 +1,8 @@
+2016-03-02  Marcin Kościelnicki  <koriakin@0x04.net>
+
+       * tracepoint.c (cmd_qtstart): Only set ipa_tdesc_idx if agent
+       is actually loaded.
+
 2016-02-25  Marcin Kościelnicki  <koriakin@0x04.net>
 
        * linux-s390-low.c (s390_num_regs_3264): Define on 31-bit too.
index dbd0b46dce9fddb678a3a0b980f87986300adcce..383fb71398ccd35d2e23d40750fd026a4fdca9bf 100644 (file)
@@ -3214,10 +3214,13 @@ cmd_qtstart (char *packet)
 
   *packet = '\0';
 
-  /* Tell IPA about the correct tdesc.  */
-  if (write_inferior_integer (ipa_sym_addrs.addr_ipa_tdesc_idx,
-                             target_get_ipa_tdesc_idx ()))
-    error ("Error setting ipa_tdesc_idx variable in lib");
+  if (agent_loaded_p ())
+    {
+      /* Tell IPA about the correct tdesc.  */
+      if (write_inferior_integer (ipa_sym_addrs.addr_ipa_tdesc_idx,
+                                 target_get_ipa_tdesc_idx ()))
+        error ("Error setting ipa_tdesc_idx variable in lib");
+    }
 
   /* Start out empty.  */
   if (agent_loaded_p ())