projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[AArch64][PATCH 2/3] Adjust a utility function for floating point values.
[deliverable/binutils-gdb.git]
/
gdb
/
reverse.c
diff --git
a/gdb/reverse.c
b/gdb/reverse.c
index d501ceb6e317b069bfb9b80b4e51c56a08a11264..ec8e4fc4591c41bfb7d7247feb71dd1e22b8cf1d 100644
(file)
--- a/
gdb/reverse.c
+++ b/
gdb/reverse.c
@@
-1,7
+1,6
@@
/* Reverse execution and reverse debugging.
/* Reverse execution and reverse debugging.
- Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 2006-2015 Free Software Foundation, Inc.
This file is part of GDB.
This file is part of GDB.
@@
-19,12
+18,13
@@
along with this program. If not, see <http://www.gnu.org/licenses/>. */
#include "defs.h"
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 "target.h"
#include "top.h"
#include "cli/cli-cmds.h"
#include "cli/cli-decode.h"
+#include "cli/cli-utils.h"
#include "inferior.h"
#include "inferior.h"
+#include "infrun.h"
#include "regcache.h"
/* User interface:
#include "regcache.h"
/* User interface:
@@
-49,9
+49,6
@@
exec_reverse_once (char *cmd, char *args, int from_tty)
enum exec_direction_kind dir = execution_direction;
struct cleanup *old_chain;
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);
if (dir == EXEC_REVERSE)
error (_("Already in reverse mode. Use '%s' or 'set exec-dir forward'."),
cmd);
@@
-145,7
+142,7
@@
save_bookmark_command (char *args, int from_tty)
error (_("target_get_bookmark failed."));
/* Set up a bookmark struct. */
error (_("target_get_bookmark failed."));
/* Set up a bookmark struct. */
- b =
xcalloc (1, sizeof (struct bookmark)
);
+ b =
XCNEW (struct bookmark
);
b->number = ++bookmark_count;
init_sal (&b->sal);
b->pc = regcache_read_pc (get_current_regcache ());
b->number = ++bookmark_count;
init_sal (&b->sal);
b->pc = regcache_read_pc (get_current_regcache ());
@@
-186,7
+183,7
@@
delete_one_bookmark (int num)
if (b == bookmark_chain)
bookmark_chain = b->next;
if (b == bookmark_chain)
bookmark_chain = b->next;
- /* Find bookmark prece
e
ding "marked" one, so we can unlink. */
+ /* Find bookmark preceding "marked" one, so we can unlink. */
if (b)
{
ALL_BOOKMARKS (b1)
if (b)
{
ALL_BOOKMARKS (b1)
@@
-219,8
+216,8
@@
delete_all_bookmarks (void)
static void
delete_bookmark_command (char *args, int from_tty)
{
static void
delete_bookmark_command (char *args, int from_tty)
{
- struct bookmark *b;
int num;
int num;
+ struct get_number_or_range_state state;
if (bookmark_chain == NULL)
{
if (bookmark_chain == NULL)
{
@@
-236,9
+233,10
@@
delete_bookmark_command (char *args, int from_tty)
return;
}
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);
if (!delete_one_bookmark (num))
/* Not found. */
warning (_("No bookmark #%d."), num);
@@
-252,16
+250,17
@@
goto_bookmark_command (char *args, int from_tty)
{
struct bookmark *b;
unsigned long num;
{
struct bookmark *b;
unsigned long num;
+ char *p = args;
if (args == NULL || args[0] == '\0')
error (_("Command requires an argument."));
if (args == NULL || args[0] == '\0')
error (_("Command requires an argument."));
- if (st
rncmp (args, "start", strlen ("start")) == 0
- || st
rncmp (args, "begin", strlen ("begin")) == 0
- || st
rncmp (args, "end", strlen ("end")) == 0
)
+ if (st
artswith (args, "start")
+ || st
artswith (args, "begin")
+ || st
artswith (args, "end")
)
{
/* Special case. Give target opportunity to handle. */
{
/* Special case. Give target opportunity to handle. */
- target_goto_bookmark (args, from_tty);
+ target_goto_bookmark (
(gdb_byte *)
args, from_tty);
return;
}
return;
}
@@
-270,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);
/* 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);
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;
ALL_BOOKMARKS (b)
if (b->number == num)
break;
@@
-287,7
+290,7
@@
goto_bookmark_command (char *args, int from_tty)
return;
}
/* Not found. */
return;
}
/* Not found. */
- error (_("goto-bookmark: no bookmark found for '%s'."),
args
);
+ error (_("goto-bookmark: no bookmark found for '%s'."),
p
);
}
static int
}
static int
@@
-327,11
+330,16
@@
bookmarks_info (char *args, int from_tty)
else if (args == NULL || *args == '\0')
bookmark_1 (-1);
else
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.029704 seconds
and
4
git commands to generate.