This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Reverse debugging, part 1/3: target interface
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Michael Snyder <msnyder at redhat dot com>
- Cc: gdb-patches at sources dot redhat dot com
- Date: Sat, 01 Apr 2006 15:23:46 +0300
- Subject: Re: [RFA] Reverse debugging, part 1/3: target interface
- References: <442DAA70.5070203@redhat.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Fri, 31 Mar 2006 14:17:20 -0800
> From: Michael Snyder <msnyder@redhat.com>
>
> OK, folks, ready to submit this for real.
Thanks!
> + /* Forward/reverse execution direction.
> + These will only be implemented by a target that supports reverse execution.
> + */
> + #define target_get_execution_direction() \
> + (current_target.to_get_execdir ? \
> + (*current_target.to_get_execdir) () : EXEC_ERROR)
Isn't it better if the default will be EXEC_FORWARD, not EXEC_ERROR?
> + /* Reverse execution.
> + FIXME: set up as a capability. */
> + static enum exec_direction_kind remote_execdir = EXEC_FORWARD;
> +
> + static enum exec_direction_kind remote_get_execdir (void)
> + {
> + if (remote_debug && info_verbose)
> + printf_filtered ("remote execdir is %s\n",
> + remote_execdir == EXEC_FORWARD ? "forward" :
> + remote_execdir == EXEC_REVERSE ? "reverse" :
> + "unknown");
> + return remote_execdir;
> + }
> +
> + static int remote_set_execdir (enum exec_direction_kind dir)
> + {
> + if (remote_debug && info_verbose)
> + printf_filtered ("Set remote execdir: %s\n",
> + dir == EXEC_FORWARD ? "forward" :
> + dir == EXEC_REVERSE ? "reverse" :
> + "bad direction");
> +
> + /* FIXME: check target for capability. */
> + if (dir == EXEC_FORWARD || dir == EXEC_REVERSE)
> + return (remote_execdir = dir);
> + else
> + return EXEC_ERROR;
> + }
I don't understand these two methods--they don't seem to do anything
that their names imply. What am I missing?