]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
2011-07-06 Hui Zhu <teawater@gmail.com>
authorHui Zhu <teawater@gmail.com>
Wed, 6 Jul 2011 02:43:12 +0000 (02:43 +0000)
committerHui Zhu <teawater@gmail.com>
Wed, 6 Jul 2011 02:43:12 +0000 (02:43 +0000)
* remote.c (remote_start_remote): Add TRY_CATCH for
remote_get_trace_status.
* tracepoint.c (disconnect_tracing): Ditto.

gdb/ChangeLog
gdb/remote.c
gdb/tracepoint.c

index a0b3d0b6db4bfc3b3ae9df9e9fc01350f4c5c8d7..951039a63075794dec19a0b482b4a0d7d60aadc0 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-06  Hui Zhu  <teawater@gmail.com>
+
+       * remote.c (remote_start_remote): Add TRY_CATCH for
+       remote_get_trace_status.
+       * tracepoint.c (disconnect_tracing): Ditto.
+
 2011-07-05  Tom Tromey  <tromey@redhat.com>
 
        * symtab.c (operator_chars): Now static.
index 19cc0b6748861c77d51d59cbae1af61f97a6b40d..b03ef596c6ffa487fe2d8a6b51ff409ab36c378d 100644 (file)
@@ -3146,6 +3146,8 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p)
   struct remote_state *rs = get_remote_state ();
   struct packet_config *noack_config;
   char *wait_status = NULL;
+  int ret = 0;
+  volatile struct gdb_exception ex;
 
   immediate_quit++;            /* Allow user to interrupt it.  */
 
@@ -3389,7 +3391,16 @@ remote_start_remote (int from_tty, struct target_ops *target, int extended_p)
 
   /* Possibly the target has been engaged in a trace run started
      previously; find out where things are at.  */
-  if (remote_get_trace_status (current_trace_status ()) != -1)
+  TRY_CATCH (ex, RETURN_MASK_ERROR)
+    {
+      ret = remote_get_trace_status (current_trace_status ());
+    }
+  if (ex.reason < 0)
+    {
+      warning (_("%s"), ex.message);
+      ret = -1;
+    }
+  if (ret != -1)
     {
       struct uploaded_tp *uploaded_tps = NULL;
       struct uploaded_tsv *uploaded_tsvs = NULL;
index 2d62f4d72ec687d28ce0bbd00eaa300279112c44..4c54d2d0b21fc512dc235d6eb1f4ef2c7ac21c42 100644 (file)
@@ -1900,11 +1900,23 @@ trace_status_mi (int on_stop)
 void
 disconnect_tracing (int from_tty)
 {
+  int ret = 0;
+  volatile struct gdb_exception ex;
+
   /* It can happen that the target that was tracing went away on its
      own, and we didn't notice.  Get a status update, and if the
      current target doesn't even do tracing, then assume it's not
      running anymore.  */
-  if (target_get_trace_status (current_trace_status ()) < 0)
+  TRY_CATCH (ex, RETURN_MASK_ERROR)
+    {
+      ret = target_get_trace_status (current_trace_status ());
+    }
+  if (ex.reason < 0)
+    {
+      warning (_("%s"), ex.message);
+      ret = -1;
+    }
+  if (ret < 0)
     current_trace_status ()->running = 0;
 
   /* If running interactively, give the user the option to cancel and