This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Enable x86 XML target descriptions


> Date: Mon, 22 Feb 2010 06:17:29 -0800
> From: "H.J. Lu" <hjl.tools@gmail.com>
>
> >> +/* Get Linux/x86 target description from running target. ?*/
> >> +
> >> +static const struct target_desc *
> >> +amd64_linux_read_description (struct target_ops *ops)
> >> +{
> >> + ?if (gdbarch_ptr_bit (target_gdbarch) == 64)
> >> + ? ?return tdesc_amd64_linux;
> >> + ?else
> >> + ? ?return tdesc_i386_linux;
> >> +}
> >> +
> >
> > This made me wonder what happens if you attach to a process without
> > loading an executable first. ?Currently this works, since GDB can
> > figure out what executable belongs to the the process and load the
> > executable automatically. ?But I fear a chicken & egg problem here:
> > the gdbarch is derviced from the tdesc, but in order to determine the
> > tdesc you need a gdbarch.
> 
> How do you attach to a process without loading an executable first?
> Gdb has to load something to debug. Do you have a testcase? I will
> fix it if it doesn't work already.

$ gdb
...
(gdb) attach PID


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]