This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/3] Add sp_regnum_from_eax and pc_regnum_from_eax
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Mark Kettenis <mark dot kettenis at xs4all dot nl>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 3 Jul 2012 08:54:22 -0700
- Subject: Re: [PATCH 1/3] Add sp_regnum_from_eax and pc_regnum_from_eax
- References: <20120621181452.GA23413@intel.com> <201207031408.q63E8DbR009742@glazunov.sibelius.xs4all.nl>
On Tue, Jul 3, 2012 at 7:08 AM, Mark Kettenis <mark.kettenis@xs4all.nl> wrote:
>> Date: Thu, 21 Jun 2012 11:14:52 -0700
>> From: "H.J. Lu" <hongjiu.lu@intel.com>
>>
>> Hi,
>>
>> Here are the first of the last 3 patches for x32 support in GDB. This
>> patch maps $pc to $eip and $sp to $esp for x32. OK to install?
>
> The pseudo register handling code is getting too complex :(. I feel
> that hiding the set_gdbarch_pc_regnum() and set_gdbarch_sp_regnum()
> calls in i386-tdep.c isn't the right approach. But I haven't found a
> better one yet :(.
>
One possibility is to set pc/sp to register name instead of regnum.
i386_gdbarch_init can map them to regnum after all pseudo registers
are finalized.
--
H.J.