From: Pedro Alves <palves@redhat.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: "H.J. Lu" <hongjiu.lu@intel.com>, GDB <gdb-patches@sourceware.org>
Subject: Re: PATCH: Convert siginfo for x32 in gdbserver
Date: Thu, 12 Apr 2012 21:26:00 -0000 [thread overview]
Message-ID: <4F8741F6.50105@redhat.com> (raw)
In-Reply-To: <20120412202551.GA5901@intel.com>
On 04/12/2012 09:25 PM, H.J. Lu wrote:
> +/* Is this process 64-bit? */
> +static int linux_is_elf64;
> #endif /* __x86_64__ */
>
> /* Convert a native/host siginfo object, into/from the siginfo in the
> @@ -934,6 +1111,21 @@ x86_siginfo_fixup (siginfo_t *native, void *inf, int direction)
>
> return 1;
> }
> + /* No fixup for native x32 GDB. */
> + else if (!linux_is_elf64 && sizeof (void *) == 8)
> + {
> + if (sizeof (siginfo_t) != sizeof (compat_x32_siginfo_t))
> + fatal ("unexpected difference in siginfo");
> +
> + if (direction == 0)
> + compat_x32_siginfo_from_siginfo ((struct compat_x32_siginfo *) inf,
> + native);
> + else
> + siginfo_from_compat_x32_siginfo (native,
> + (struct compat_x32_siginfo *) inf);
> +
> + return 1;
> + }
> #endif
>
> return 0;
> @@ -1138,6 +1330,7 @@ x86_arch_setup (void)
> /* Amd64 has 16 xmm regs. */
> num_xmm_registers = 16;
>
> + linux_is_elf64 = is_elf64;
> x86_linux_update_xmltarget ();
> return;
> }
This new global is buggy in that in extended-remote mode (gdbserver --multi):
you can start a 64-bit inferior, kill it, then start a 32-bit inferior.
So clear it also in the 32-bit inferior case. Okay with that change.
This new flag should be made a per-inferior flag, probably as a
new process->private->is_elf64 flag, but the status quo is that
there are other similar globals, so I'm okay with a new one,
and I'll fix them all in the ongoing multi-process+multi-arch
series.
Thanks.
--
Pedro Alves
prev parent reply other threads:[~2012-04-12 20:58 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-12 17:21 H.J. Lu
2012-04-12 20:14 ` Pedro Alves
2012-04-12 20:58 ` H.J. Lu
2012-04-12 20:27 ` H.J. Lu
2012-04-12 21:26 ` Pedro Alves [this message]
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=4F8741F6.50105@redhat.com \
--to=palves@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=hjl.tools@gmail.com \
--cc=hongjiu.lu@intel.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