This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Two minor issues
On Wed, Aug 27, 2008 at 10:45:49AM -0300, Thiago Jung Bauermann wrote:
> On Wed, 2008-08-27 at 08:55 -0300, Dr. Rolf Jansen wrote:
> > Is there a global way to find out at compile-time at the build or host
> > system the ptr-size and the long-size of the configured target
> > machine, something like size_attarget_of()?
>
> It's not enough to do that at compile time, since some targets support
> running both 32-bit and 64-bit programs (e.g., ppc64-linux). You can
> check at runtime, if you have a struct gdbarch nearby:
Not in arch-independent code:
> struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
since tdep is Target-DEPendent. But you can use the TYPE_LENGTH of
builtin types; see e.g. gnu-v3-abi.c.
--
Daniel Jacobowitz
CodeSourcery