2011-10-31 Pedro Alves <pedro@codesourcery.com>
[deliverable/binutils-gdb.git] / gdb / reverse.c
index 7169cc3e63e57fb77b393b38d9115c57614360f2..1437b406eced0ecd3e3496a356b5472066261a15 100644 (file)
@@ -50,9 +50,6 @@ exec_reverse_once (char *cmd, char *args, int from_tty)
   enum exec_direction_kind dir = execution_direction;
   struct cleanup *old_chain;
 
-  if (dir == EXEC_ERROR)
-    error (_("Target %s does not support this command."), target_shortname);
-
   if (dir == EXEC_REVERSE)
     error (_("Already in reverse mode.  Use '%s' or 'set exec-dir forward'."),
           cmd);
@@ -187,7 +184,7 @@ delete_one_bookmark (int num)
   if (b == bookmark_chain)
     bookmark_chain = b->next;
 
-  /* Find bookmark preceeding "marked" one, so we can unlink.  */
+  /* Find bookmark preceding "marked" one, so we can unlink.  */
   if (b)
     {
       ALL_BOOKMARKS (b1)
@@ -222,6 +219,7 @@ delete_bookmark_command (char *args, int from_tty)
 {
   struct bookmark *b;
   int num;
+  struct get_number_or_range_state state;
 
   if (bookmark_chain == NULL)
     {
@@ -237,9 +235,10 @@ delete_bookmark_command (char *args, int from_tty)
       return;
     }
 
-  while (args != NULL && *args != '\0')
+  init_number_or_range (&state, args);
+  while (!state.finished)
     {
-      num = get_number_or_range (&args);
+      num = get_number_or_range (&state);
       if (!delete_one_bookmark (num))
        /* Not found.  */
        warning (_("No bookmark #%d."), num);
@@ -328,11 +327,16 @@ bookmarks_info (char *args, int from_tty)
   else if (args == NULL || *args == '\0')
     bookmark_1 (-1);
   else
-    while (args != NULL && *args != '\0')
-      {
-       bnum = get_number_or_range (&args);
-       bookmark_1 (bnum);
-      }
+    {
+      struct get_number_or_range_state state;
+
+      init_number_or_range (&state, args);
+      while (!state.finished)
+       {
+         bnum = get_number_or_range (&state);
+         bookmark_1 (bnum);
+       }
+    }
 }
 
 
This page took 0.024825 seconds and 4 git commands to generate.