From: Hui Zhu <teawater@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: gdb-patches@sourceware.org
Subject: Re: Process record and replay checked in to main trunk
Date: Sun, 03 May 2009 13:54:00 -0000 [thread overview]
Message-ID: <daef60380905030654o6e4d82caoc7c096708973f970@mail.gmail.com> (raw)
In-Reply-To: <83ws91c5sp.fsf@gnu.org>
Hi Eli,
On Fri, May 1, 2009 at 21:27, Eli Zaretskii <eliz@gnu.org> wrote:
> It would be nice if i386-tdep.c had some comments about what it takes
> for another x86 target to add support for process recording and
> replay. Apologies if it's already described somewhere and I missed
> it.
>
> It looks like all is needed is to define suitable functions for
> tdep->i386_intx80_record and tdep->i386_sysenter_record, is that
> right? (If so, why so Linux-centric names?)
The intx80 and sysenter function pointers is the interface for
i386-os-tdep code to set intx86 insn and sysenter special record
functions.
Because some os (linux) have special function in intx80 and sysenter
(system call).
So, in other arch, maybe there will have other interface. For
example, arm will have a swi interface, mips will have a syscall
interface.
>
> Also, some architectural overview of how the record/replay target
> works would be nice, either in the comments or in gdbint.texinfo. For
> example, just looking at i386_linux_intx80_sysenter_record, I cannot
> understand how it succeed to record both the arguments to the syscall
> and the return value. The syscall itself does not happen inside
> record_linux_system_call, that just records the syscall parameters and
> data buffers, right? And recording happens _before_ the instruction
> being recorded executes, right? So how come
> i386_linux_intx80_sysenter_record can use EAX as the syscall number
> and immediately after the call to record_linux_system_call treat the
> value of EAX as the value returned by the syscall? What am I missing
> here?
This is because all record work will be done before insn execute.
Before insn execute, p record parse this insn. Find out which
register and memory will be changed in this insn. Record the old
value of the reg and mem.
So, syscall doesn't really need execute in function
i386_linux_intx80_sysenter_record.
>
> It probably doesn't help that I don't know enough about how the target
> stack works, but that isn't described, either, at least not in
> target.[ch], right? The only thing I found is some very high-level
> description at the beginning of target.h.
>
I don't know which doc have the description for. Maybe read code
target.c:update_current_target will help to make clear stack works.
All of them are very good questions. Please tell me if you still have
problems with them.
Thanks,
Hui
next prev parent reply other threads:[~2009-05-03 13:54 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-30 7:59 Hui Zhu
2009-04-30 14:43 ` Marc Khouzam
2009-04-30 20:00 ` Michael Snyder
2009-05-01 9:16 ` Eli Zaretskii
2009-05-01 17:02 ` Hui Zhu
2009-05-01 17:55 ` Eli Zaretskii
2009-05-03 14:15 ` Hui Zhu
2009-05-04 11:17 ` Eli Zaretskii
2009-05-04 16:46 ` Michael Snyder
2009-05-05 13:48 ` Hui Zhu
2009-05-04 14:32 ` Marc Khouzam
2009-05-04 16:46 ` Eli Zaretskii
2009-05-05 14:11 ` Hui Zhu
2009-05-01 9:26 ` Eli Zaretskii
2009-05-01 17:08 ` Hui Zhu
2009-05-01 17:58 ` Eli Zaretskii
2009-05-01 13:28 ` Eli Zaretskii
2009-05-03 13:54 ` Hui Zhu [this message]
2009-05-04 11:15 ` Eli Zaretskii
2009-05-05 13:40 ` Hui Zhu
2009-05-05 19:01 ` Eli Zaretskii
2009-05-05 19:32 ` Mark Kettenis
2009-05-05 19:52 ` Eli Zaretskii
2009-05-06 13:34 ` Hui Zhu
[not found] ` <daef60380904300102o4470ac45he41f6b72176b1947@mail.gmail.com>
2009-05-07 22:24 ` Pierre Muller
2009-05-07 22:52 ` Michael Snyder
2009-05-07 23:05 ` Pedro Alves
2009-05-08 5:12 ` Hui Zhu
2009-05-08 12:11 ` Pierre Muller
2009-05-10 17:28 ` Hui Zhu
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=daef60380905030654o6e4d82caoc7c096708973f970@mail.gmail.com \
--to=teawater@gmail.com \
--cc=eliz@gnu.org \
--cc=gdb-patches@sourceware.org \
/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