This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Get rid of the EXEC_ERROR execution direction
- From: Pedro Alves <pedro at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Date: Thu, 26 May 2011 19:24:58 +0100
- Subject: Get rid of the EXEC_ERROR execution direction
Nothing ever sets anything to EXEC_ERROR.
Tested on x86_64-linux (w/ precord) and applied.
--
Pedro Alves
2011-05-26 Pedro Alves <pedro@codesourcery.com>
gdb/
* inferior.h (enum exec_direction_kind): Delete EXEC_ERROR.
* infrun.c (show_exec_direction_func): Don't handle EXEC_ERROR.
Internal error on invalid values.
* reverse.c: Don't handle EXEC_ERROR.
* mi/mi-main.c: Don't handle EXEC_ERROR.
---
gdb/inferior.h | 3 +--
gdb/infrun.c | 8 +++-----
gdb/mi/mi-main.c | 3 ---
gdb/reverse.c | 3 ---
4 files changed, 4 insertions(+), 13 deletions(-)
Index: src/gdb/inferior.h
===================================================================
--- src.orig/gdb/inferior.h 2011-05-26 18:56:33.000000000 +0100
+++ src/gdb/inferior.h 2011-05-26 19:17:42.891251286 +0100
@@ -352,8 +352,7 @@ enum stop_kind
enum exec_direction_kind
{
EXEC_FORWARD,
- EXEC_REVERSE,
- EXEC_ERROR
+ EXEC_REVERSE
};
/* The current execution direction. This should only be set to enum
Index: src/gdb/infrun.c
===================================================================
--- src.orig/gdb/infrun.c 2011-05-26 18:42:20.000000000 +0100
+++ src/gdb/infrun.c 2011-05-26 19:19:10.111251256 +0100
@@ -6920,12 +6920,10 @@ show_exec_direction_func (struct ui_file
case EXEC_REVERSE:
fprintf_filtered (out, _("Reverse.\n"));
break;
- case EXEC_ERROR:
default:
- fprintf_filtered (out, _("Forward (target `%s' does not "
- "support exec-direction).\n"),
- target_shortname);
- break;
+ internal_error (__FILE__, __LINE__,
+ _("bogus execution_direction value: %d"),
+ (int) execution_direction);
}
}
Index: src/gdb/reverse.c
===================================================================
--- src.orig/gdb/reverse.c 2011-05-25 16:50:10.000000000 +0100
+++ src/gdb/reverse.c 2011-05-26 19:18:03.341251279 +0100
@@ -50,9 +50,6 @@ exec_reverse_once (char *cmd, char *args
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);
Index: src/gdb/mi/mi-main.c
===================================================================
--- src.orig/gdb/mi/mi-main.c 2011-05-20 17:23:51.000000000 +0100
+++ src/gdb/mi/mi-main.c 2011-05-26 19:18:16.411251274 +0100
@@ -285,9 +285,6 @@ exec_reverse_continue (char **argv, int
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."));