From: "Michael Snyder" <msnyder@sonic.net>
To: <gdb-patches@sources.redhat.com>
Cc: <eliz@gnu.org>
Subject: Re: [RFA] Reverse debugging, part 1/3: target interface
Date: Sat, 01 Apr 2006 16:39:00 -0000 [thread overview]
Message-ID: <000901c655aa$78832620$677ba8c0@sonic.net> (raw)
Eli writes:
>> + /* 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?
Well, I wanted a way to probe and find out whether the target
implements these methods at all. If you call get_execdir and
get back "error", you can report "sorry, this target doesn't support it".
I can see your argument, that you could simply report "yes,
you're going forward" -- but then the only way to probe
would be to call target_SET_execdir, and that seems too
intrusive for a probe.
Of course, I could just add a third target vector element,
but that seemed like overkill. Perhaps I'm trying to be
too clever?
>> + /* 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?
It's deceptively simple. ;-)
The two methods just get and set the value of a local mode variable,
remote_execdir. That's all. Then that variable is used by remote_wait
and remote_resume.
next reply other threads:[~2006-04-01 16:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-01 16:39 Michael Snyder [this message]
[not found] <442DAA70.5070203@redhat.com>
2006-04-01 12:23 ` Eli Zaretskii
2006-04-17 23:37 ` Michael Snyder
2006-04-18 12:58 ` Daniel Jacobowitz
2006-04-18 15:24 ` Daniel Jacobowitz
2006-04-18 22:08 ` Michael Snyder
2006-04-19 8:48 ` Eli Zaretskii
2006-04-19 18:26 ` Michael Snyder
2006-04-20 9:18 ` Eli Zaretskii
2006-04-20 13:43 ` Daniel Jacobowitz
2006-04-20 19:22 ` Michael Snyder
2006-04-20 19:50 ` Daniel Jacobowitz
2006-04-20 23:53 ` Michael Snyder
2006-04-24 20:55 ` Daniel Jacobowitz
2006-04-18 18:59 ` Michael Snyder
2006-04-20 13:58 ` Daniel Jacobowitz
2006-04-20 19:42 ` Michael Snyder
2006-04-20 19:58 ` Daniel Jacobowitz
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='000901c655aa$78832620$677ba8c0@sonic.net' \
--to=msnyder@sonic.net \
--cc=eliz@gnu.org \
--cc=gdb-patches@sources.redhat.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