From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: teawater@gmail.com
Cc: gdb-patches@sourceware.org, msnyder@vmware.com
Subject: Re: [RFA] Make the prec support signal better[3/4] -- i386-linux
Date: Wed, 09 Sep 2009 13:45:00 -0000 [thread overview]
Message-ID: <200909091345.n89DjW0u028957@brahms.sibelius.xs4all.nl> (raw)
In-Reply-To: <daef60380909090629r25ad8520pb14baaa86d406202@mail.gmail.com> (message from Hui Zhu on Wed, 9 Sep 2009 21:29:07 +0800)
> From: Hui Zhu <teawater@gmail.com>
> Date: Wed, 9 Sep 2009 21:29:07 +0800
>
> This patch make i386-linux support signal record.
> When signal happen, i386_linux_record_signal will record the change.
> When the signal handler want return, new code in
> "i386_linux_intx80_sysenter_record" will record the change.
>
> i386-linux-tdep.c | 71 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 71 insertions(+)
>
> --- a/i386-linux-tdep.c
> +++ b/i386-linux-tdep.c
> @@ -354,6 +354,33 @@ i386_linux_write_pc (struct regcache *re
> regcache_cooked_write_unsigned (regcache, I386_LINUX_ORIG_EAX_REGNUM, -1);
> }
>
> +/* Record all registers for process-record. */
Not quite true isn't it?
> +static int
> +i386_all_but_ip_registers_record (struct regcache *regcache)
> +{
> + if (record_arch_list_add_reg (regcache, I386_EAX_REGNUM))
> + return -1;
> + if (record_arch_list_add_reg (regcache, I386_ECX_REGNUM))
> + return -1;
> + if (record_arch_list_add_reg (regcache, I386_EDX_REGNUM))
> + return -1;
> + if (record_arch_list_add_reg (regcache, I386_EBX_REGNUM))
> + return -1;
> + if (record_arch_list_add_reg (regcache, I386_ESP_REGNUM))
> + return -1;
> + if (record_arch_list_add_reg (regcache, I386_EBP_REGNUM))
> + return -1;
> + if (record_arch_list_add_reg (regcache, I386_ESI_REGNUM))
> + return -1;
> + if (record_arch_list_add_reg (regcache, I386_EDI_REGNUM))
> + return -1;
> + if (record_arch_list_add_reg (regcache, I386_EFLAGS_REGNUM))
> + return -1;
> +
> + return 0;
> +}
Why exactly is it that you're not recording the instruction pointer?
> static struct linux_record_tdep i386_linux_record_tdep;
>
> /* i386_canonicalize_syscall maps from the native i386 Linux set
> @@ -388,6 +415,14 @@ i386_linux_intx80_sysenter_record (struc
>
> regcache_raw_read_signed (regcache, I386_EAX_REGNUM, &syscall_native);
>
> + if (syscall_native == 119 || syscall_native == 173)
> + {
Ugh, magic numbers. We have symbolic constants for them isn't it?
Any reason not to use them?
> +enum i386_linux_signal_stack {
> + xstate = 270,
> + frame_size = 732,
> +};
IMHO, these should be #define's, spelled with all capitals and have
I386_LINUX_ prefixes.
next prev parent reply other threads:[~2009-09-09 13:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-09 13:29 Hui Zhu
2009-09-09 13:45 ` Mark Kettenis [this message]
2009-09-10 1:51 ` 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=200909091345.n89DjW0u028957@brahms.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.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