+2015-10-13 Pedro Alves <palves@redhat.com>
+
+ * infrun.c (restore_execution_direction): New function.
+ (fetch_inferior_event): Use it instead of
+ make_cleanup_restore_integer.
+ (execution_direction): Change type to enum
+ exec_direction_kind.
+ * infrun.h (execution_direction): Likewise.
+
2015-10-13 Pedro Alves <palves@redhat.com>
* ada-lang.c (ada_value_primitive_packed_val): Constify
}
}
+/* A cleanup that restores the execution direction to the value saved
+ in *ARG. */
+
+static void
+restore_execution_direction (void *arg)
+{
+ enum exec_direction_kind *save_exec_dir = (enum exec_direction_kind *) arg;
+
+ execution_direction = *save_exec_dir;
+}
+
/* Asynchronous version of wait_for_inferior. It is called by the
event loop whenever a change of state is detected on the file
descriptor corresponding to the target. It can be called more than
struct cleanup *old_chain = make_cleanup (null_cleanup, NULL);
struct cleanup *ts_old_chain;
int was_sync = sync_execution;
+ enum exec_direction_kind save_exec_dir = execution_direction;
int cmd_done = 0;
ptid_t waiton_ptid = minus_one_ptid;
event. */
target_dcache_invalidate ();
- make_cleanup_restore_integer (&execution_direction);
+ make_cleanup (restore_execution_direction, &save_exec_dir);
execution_direction = target_execution_direction ();
ecs->ptid = do_target_wait (waiton_ptid, &ecs->ws,
Set exec-direction / show exec-direction commands
(returns error unless target implements to_set_exec_direction method). */
-int execution_direction = EXEC_FORWARD;
+enum exec_direction_kind execution_direction = EXEC_FORWARD;
static const char exec_forward[] = "forward";
static const char exec_reverse[] = "reverse";
static const char *exec_direction = exec_forward;
EXEC_REVERSE
};
-/* The current execution direction. This should only be set to enum
- exec_direction_kind values. It is only an int to make it
- compatible with make_cleanup_restore_integer. */
-extern int execution_direction;
+/* The current execution direction. */
+extern enum exec_direction_kind execution_direction;
extern void start_remote (int from_tty);