* breakpoint.c (gdb_breakpoint_query): Really return an
authorDaniel Jacobowitz <drow@false.org>
Tue, 10 Apr 2007 14:53:46 +0000 (14:53 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 10 Apr 2007 14:53:46 +0000 (14:53 +0000)
enum gdb_rc.
(gdb_breakpoint): Likewise.
* thread.c (do_captured_list_thread_ids): Likewise.
(do_captured_thread_select): Likewise.
* mi/mi-main.c (mi_cmd_thread_select): Expect an enum gdb_rc.
(mi_cmd_thread_list_ids): Remove bogus initialization.

gdb/ChangeLog
gdb/breakpoint.c
gdb/mi/mi-main.c
gdb/thread.c

index 477de9ef9bc5c5c3081d4af24d8fae9d5a11b707..b123a9582db4dede229932b4d333c2c86935e98a 100644 (file)
@@ -1,3 +1,13 @@
+2007-04-10  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * breakpoint.c (gdb_breakpoint_query): Really return an
+       enum gdb_rc.
+       (gdb_breakpoint): Likewise.
+       * thread.c (do_captured_list_thread_ids): Likewise.
+       (do_captured_thread_select): Likewise.
+       * mi/mi-main.c (mi_cmd_thread_select): Expect an enum gdb_rc.
+       (mi_cmd_thread_list_ids): Remove bogus initialization.
+
 2007-04-10  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * Makefile.in (SFILES): Remove hpacc-abi.c.
index fc8e389d3a72a0a8fd36fe8de1b7ba64324117f3..4ca386cfabfc6faef7108ff6c6d7d8deda17151a 100644 (file)
@@ -3757,8 +3757,11 @@ gdb_breakpoint_query (struct ui_out *uiout, int bnum, char **error_message)
   args.bnum = bnum;
   /* For the moment we don't trust print_one_breakpoint() to not throw
      an error. */
-  return catch_exceptions_with_msg (uiout, do_captured_breakpoint_query, &args,
-                                   error_message, RETURN_MASK_ALL);
+  if (catch_exceptions_with_msg (uiout, do_captured_breakpoint_query, &args,
+                                error_message, RETURN_MASK_ALL) < 0)
+    return GDB_RC_FAIL;
+  else
+    return GDB_RC_OK;
 }
 
 /* Return non-zero if B is user settable (breakpoints, watchpoints,
@@ -5600,8 +5603,11 @@ gdb_breakpoint (char *address, char *condition,
   args.tempflag = tempflag;
   args.thread = thread;
   args.ignore_count = ignore_count;
-  return catch_exceptions_with_msg (uiout, do_captured_breakpoint, &args,
-                                   error_message, RETURN_MASK_ALL);
+  if (catch_exceptions_with_msg (uiout, do_captured_breakpoint, &args,
+                                error_message, RETURN_MASK_ALL) < 0)
+    return GDB_RC_FAIL;
+  else
+    return GDB_RC_OK;
 }
 
 
index 449e7d0c3d6c04b242e017262d6e84319667aadb..bdbb309e5435f2cab958f6eca90d15f685aacabf 100644 (file)
@@ -253,11 +253,7 @@ mi_cmd_thread_select (char *command, char **argv, int argc)
   else
     rc = gdb_thread_select (uiout, argv[0], &mi_error_message);
 
-  /* RC is enum gdb_rc if it is successful (>=0)
-     enum return_reason if not (<0).  */
-  if ((int) rc < 0 && (enum return_reason) rc == RETURN_ERROR)
-    return MI_CMD_ERROR;
-  else if ((int) rc >= 0 && rc == GDB_RC_FAIL)
+  if (rc == GDB_RC_FAIL)
     return MI_CMD_ERROR;
   else
     return MI_CMD_DONE;
@@ -266,7 +262,7 @@ mi_cmd_thread_select (char *command, char **argv, int argc)
 enum mi_cmd_result
 mi_cmd_thread_list_ids (char *command, char **argv, int argc)
 {
-  enum gdb_rc rc = MI_CMD_DONE;
+  enum gdb_rc rc;
 
   if (argc != 0)
     {
index dbfd2dd82dcb3376c1e3b2a220a3cd5241f0ccef..d2a6e6fc2bdc6b04b210bbb87c3546e35b43984d 100644 (file)
@@ -284,8 +284,10 @@ do_captured_list_thread_ids (struct ui_out *uiout, void *arg)
 enum gdb_rc
 gdb_list_thread_ids (struct ui_out *uiout, char **error_message)
 {
-  return catch_exceptions_with_msg (uiout, do_captured_list_thread_ids, NULL,
-                                   error_message, RETURN_MASK_ALL);
+  if (catch_exceptions_with_msg (uiout, do_captured_list_thread_ids, NULL,
+                                error_message, RETURN_MASK_ALL) < 0)
+    return GDB_RC_FAIL;
+  return GDB_RC_OK;
 }
 
 /* Load infrun state for the thread PID.  */
@@ -705,8 +707,10 @@ do_captured_thread_select (struct ui_out *uiout, void *tidstr)
 enum gdb_rc
 gdb_thread_select (struct ui_out *uiout, char *tidstr, char **error_message)
 {
-  return catch_exceptions_with_msg (uiout, do_captured_thread_select, tidstr,
-                                   error_message, RETURN_MASK_ALL);
+  if (catch_exceptions_with_msg (uiout, do_captured_thread_select, tidstr,
+                                error_message, RETURN_MASK_ALL) < 0)
+    return GDB_RC_FAIL;
+  return GDB_RC_OK;
 }
 
 /* Commands with a prefix of `thread'.  */