This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: PATCH: Enable x86 XML target descriptions
On Mon, Feb 22, 2010 at 07:57:52AM -0800, H.J. Lu wrote:
> On Mon, Feb 22, 2010 at 7:52 AM, Daniel Jacobowitz <dan@codesourcery.com> wrote:
> > On Mon, Feb 22, 2010 at 07:34:01AM -0800, H.J. Lu wrote:
> >> I just need to know if the inferior is 32bit or 64bit. Why shouldn't
> >> target_gdbarch be used? At this point, target_gdbarch should have
> >> the correct bfd cpu info. Is that correct?
> >
> > Not if, for instance, we did not find the executable.
>
> How do you debug if you can't find executable? I am not sure if
> you can get that far.
That's not the point. You can not rely on the gdbarch here. It
breaks the entire abstraction to circularly read the architecture
description from the architecture. Plus it will do the wrong thing if
the user gives the wrong executable, and this is our chance to get it
right.
Why can't you figure this out with ptrace? Isn't there a bit in
flags, or something like that? Or a way to get at the kernel's
TIF_IA32 flag?
--
Daniel Jacobowitz
CodeSourcery