* gdbtypes.h (struct cplus_struct_type) <n_baseclasses>: Fix comment.
[deliverable/binutils-gdb.git] / gdb / reverse.c
index 171c53c230d202f0ecc343d6bbf36d0c34d19e02..ed55a3a4ddab585b0d4a64cad0da68c77e7f919b 100644 (file)
@@ -1,6 +1,6 @@
 /* Reverse execution and reverse debugging.
 
-   Copyright (C) 2006-2013 Free Software Foundation, Inc.
+   Copyright (C) 2006-2015 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-#include "gdb_string.h"
 #include "target.h"
 #include "top.h"
 #include "cli/cli-cmds.h"
 #include "cli/cli-decode.h"
 #include "cli/cli-utils.h"
 #include "inferior.h"
+#include "infrun.h"
 #include "regcache.h"
 
 /* User interface:
@@ -250,16 +250,17 @@ goto_bookmark_command (char *args, int from_tty)
 {
   struct bookmark *b;
   unsigned long num;
+  char *p = args;
 
   if (args == NULL || args[0] == '\0')
     error (_("Command requires an argument."));
 
-  if (strncmp (args, "start", strlen ("start")) == 0
-      || strncmp (args, "begin", strlen ("begin")) == 0
-      || strncmp (args, "end",   strlen ("end")) == 0)
+  if (startswith (args, "start")
+      || startswith (args, "begin")
+      || startswith (args, "end"))
     {
       /* Special case.  Give target opportunity to handle.  */
-      target_goto_bookmark (args, from_tty);
+      target_goto_bookmark ((gdb_byte *) args, from_tty);
       return;
     }
 
@@ -268,12 +269,16 @@ goto_bookmark_command (char *args, int from_tty)
       /* Special case -- quoted string.  Pass on to target.  */
       if (args[strlen (args) - 1] != args[0])
        error (_("Unbalanced quotes: %s"), args);
-      target_goto_bookmark (args, from_tty);
+      target_goto_bookmark ((gdb_byte *) args, from_tty);
       return;
     }
 
   /* General case.  Bookmark identified by bookmark number.  */
   num = get_number (&args);
+
+  if (num == 0)
+    error (_("goto-bookmark: invalid bookmark number '%s'."), p);
+
   ALL_BOOKMARKS (b)
     if (b->number == num)
       break;
@@ -285,7 +290,7 @@ goto_bookmark_command (char *args, int from_tty)
       return;
     }
   /* Not found.  */
-  error (_("goto-bookmark: no bookmark found for '%s'."), args);
+  error (_("goto-bookmark: no bookmark found for '%s'."), p);
 }
 
 static int
This page took 0.029407 seconds and 4 git commands to generate.