Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Doug Evans" <dje@google.com>
To: "Michael Snyder" <msnyder@vmware.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	        "Daniel Jacobowitz" <drow@false.org>,
	        "Pedro Alves" <pedro@codesourcery.com>,
	teawater <teawater@gmail.com>
Subject: Re: [RFA] Reverse Debugging, 1/5
Date: Fri, 03 Oct 2008 19:04:00 -0000	[thread overview]
Message-ID: <e394668d0810031203x44789ec5ke16c2416ff9b4b7a@mail.gmail.com> (raw)
In-Reply-To: <48E3CCB6.4060501@vmware.com>

On Wed, Oct 1, 2008 at 12:17 PM, Michael Snyder <msnyder@vmware.com> wrote:
>
>
> This first patch of the reverse debugging sequence affects
> only the target_ops interface (adding several target methods
> and some enums and such).
>
> Adding this patch alone does not affect gdb's behavior, and
> I have run testsuites under RHEL with no change in results.
>
>
> 2008-09-30  Michael Snyder  <msnyder@vmware.com>
>        Target interface for reverse debugging.
>        * target.h (enum target_waitkind):
>        Add new wait event, TARGET_WAITKIND_NO_HISTORY.
>        (enum exec_direction_kind): New enum.
>        (struct target_ops): New methods to_set_execdir, to_get_execdir.
>        * target.c (target_get_execdir): New generic method.
>        (target_set_execdir): Ditto.
>
> Index: target.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/target.c,v
> retrieving revision 1.184
> diff -u -p -r1.184 target.c
> --- target.c    22 Sep 2008 15:21:30 -0000      1.184
> +++ target.c    30 Sep 2008 18:19:00 -0000
> @@ -455,6 +455,8 @@ update_current_target (void)
>       INHERIT (to_find_memory_regions, t);
>       INHERIT (to_make_corefile_notes, t);
>       INHERIT (to_get_thread_local_address, t);
> +      INHERIT (to_get_execdir, t);
> +      INHERIT (to_set_execdir, t);
>       /* Do not inherit to_read_description.  */
>       /* Do not inherit to_search_memory.  */
>       INHERIT (to_magic, t);
> Index: target.h
> ===================================================================
> RCS file: /cvs/src/src/gdb/target.h,v
> retrieving revision 1.130
> diff -u -p -r1.130 target.h
> --- target.h    19 Aug 2008 13:22:14 -0000      1.130
> +++ target.h    30 Sep 2008 18:19:00 -0000
> @@ -128,7 +128,11 @@ enum target_waitkind
>        inferior, rather than being stuck in the remote_async_wait()
>        function. This way the event loop is responsive to other events,
>        like for instance the user typing.  */
> -    TARGET_WAITKIND_IGNORE
> +    TARGET_WAITKIND_IGNORE,
> +
> +    /* The target has run out of history information,
> +       and cannot run backward any further.  */
> +    TARGET_WAITKIND_NO_HISTORY
>   };
>
>  struct target_waitstatus
> @@ -147,6 +151,14 @@ struct target_waitstatus
>     value;
>   };
>
> +/* Reverse execution.  */
> +enum exec_direction_kind
> +  {
> +    EXEC_FORWARD,
> +    EXEC_REVERSE,
> +    EXEC_ERROR
> +  };
> +
>  /* Possible types of events that the inferior handler will have to
>    deal with.  */
>  enum inferior_event_type
> @@ -523,6 +535,11 @@ struct target_ops
>                             const gdb_byte *pattern, ULONGEST pattern_len,
>                             CORE_ADDR *found_addrp);
>
> +    /* Set execution direction (forward/reverse).  */
> +    int (*to_set_execdir) (enum exec_direction_kind);
> +    /* Get execution direction (forward/reverse).  */
> +    enum exec_direction_kind (*to_get_execdir) (void);
> +
>     int to_magic;
>     /* Need sub-structure for target machine related rather than comm
> related?
>      */
> @@ -1127,6 +1144,18 @@ extern int target_stopped_data_address_p
>  #define target_watchpoint_addr_within_range(target, addr, start, length) \
>   (*target.to_watchpoint_addr_within_range) (target, addr, start, length)
>
> +/* 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)
> +
> +#define target_set_execution_direction(DIR) \
> +    (current_target.to_set_execdir ? \
> +     (*current_target.to_set_execdir) (DIR) : EXEC_ERROR)
> +
> +
>  extern const struct target_desc *target_read_description (struct target_ops
> *);
>
>  /* Utility implementation of searching memory.  */

Hi.

Nit: Can all occurrences of "execdir" be replaced with
"exec_direction"?  I look at "execdir" and think "execution
directory".  [I realize often the context provides enough clues that
prevent this misinterpretation, but that's not always true.]


  reply	other threads:[~2008-10-03 19:04 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-01 19:18 Michael Snyder
2008-10-03 19:04 ` Doug Evans [this message]
2008-10-03 20:44   ` Michael Snyder
2008-10-06 20:30 ` Joel Brobecker
2008-10-06 21:03   ` Michael Snyder
2008-10-06 21:12     ` Daniel Jacobowitz
2008-10-06 21:20       ` Michael Snyder
2008-10-06 21:25         ` Daniel Jacobowitz
2008-10-06 21:46           ` Michael Snyder
2008-10-06 22:23             ` Joel Brobecker
2008-10-07  0:45               ` Michael Snyder
2008-10-07  3:49                 ` Joel Brobecker
2008-10-07 18:30                   ` Michael Snyder
2008-10-08  0:16                     ` Joel Brobecker
2008-10-08  0:32                       ` Michael Snyder
2008-10-08  0:55                         ` Joel Brobecker
2008-10-08  1:46                           ` Michael Snyder
2008-10-08  2:59                             ` Joel Brobecker
2008-10-07  5:02             ` Daniel Jacobowitz
2008-10-06 21:45     ` Pedro Alves
2008-10-06 22:14       ` Michael Snyder
2008-10-06 22:35         ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e394668d0810031203x44789ec5ke16c2416ff9b4b7a@mail.gmail.com \
    --to=dje@google.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    --cc=pedro@codesourcery.com \
    --cc=teawater@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox