From: Mark Kettenis <mark.kettenis@xs4all.nl>
To: hjl.tools@gmail.com
Cc: gdb-patches@sourceware.org
Subject: Re: PATCH: Also check for `movl %esp, %ebp' for x32
Date: Tue, 17 Apr 2012 11:51:00 -0000 [thread overview]
Message-ID: <201204171143.q3HBh9LV021759@glazunov.sibelius.xs4all.nl> (raw)
In-Reply-To: <20120410202953.GA23862@intel.com> (hongjiu.lu@intel.com)
> Date: Tue, 10 Apr 2012 13:29:53 -0700
> From: "H.J. Lu" <hongjiu.lu@intel.com>
>
> Hi,
>
> X32 may use `movl %esp, %ebp' in prologue. This patch checks it for
> x32. Tested on Linux/x86-64. OK for trunk?
Sorry, but I'm not sure it is a good idea to mix ABIs in the code like
that. Up until now, I've made a conscious attempt to keep the i386
and amd64 ABIs seperated out as much as possible. Can you post a
complete diff of the -tdep.c related changes to support x32 in GDB,
such that I can judge where this is heading?
> diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
> index d15acea..e64de21 100644
> --- a/gdb/amd64-tdep.c
> +++ b/gdb/amd64-tdep.c
> @@ -1900,10 +1927,14 @@ amd64_analyze_prologue (struct gdbarch *gdbarch,
> if (current_pc <= pc + 1)
> return current_pc;
>
> - /* Check for `movq %rsp, %rbp'. */
> + /* Check for `movq %rsp, %rbp'. Also check for `movl %esp, %ebp'
> + if it is an x32 target. */
> read_memory (pc + 1, buf, 3);
> if (memcmp (buf, mov_rsp_rbp_1, 3) != 0
> - && memcmp (buf, mov_rsp_rbp_2, 3) != 0)
> + && memcmp (buf, mov_rsp_rbp_2, 3) != 0
> + && (gdbarch_ptr_bit (gdbarch) == 64
> + || (memcmp (buf, mov_rsp_rbp_1 + 1, 2) != 0
> + && memcmp (buf, mov_rsp_rbp_2 + 1, 2) != 0)))
> return pc + 1;
>
> /* OK, we actually have a frame. */
>
next prev parent reply other threads:[~2012-04-17 11:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-10 20:52 H.J. Lu
2012-04-16 17:54 ` PING: " H.J. Lu
2012-04-17 11:35 ` Yao Qi
2012-04-17 14:41 ` H.J. Lu
2012-04-17 11:51 ` Mark Kettenis [this message]
2012-04-17 14:32 ` H.J. Lu
2012-04-24 16:33 ` H.J. Lu
2012-04-29 23:21 ` H.J. Lu
2012-05-02 21:44 ` Mark Kettenis
2012-05-02 22:14 ` H.J. Lu
2012-05-03 19:01 ` H.J. Lu
2012-05-03 21:50 ` Mark Kettenis
2012-05-03 21:52 ` H.J. Lu
2012-05-06 20:31 ` Mark Kettenis
2012-05-06 20:42 ` H.J. Lu
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=201204171143.q3HBh9LV021759@glazunov.sibelius.xs4all.nl \
--to=mark.kettenis@xs4all.nl \
--cc=gdb-patches@sourceware.org \
--cc=hjl.tools@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