This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Two minor issues
- From: Thiago Jung Bauermann <bauerman at br dot ibm dot com>
- To: "Dr. Rolf Jansen" <rolf dot anroni at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 27 Aug 2008 10:45:49 -0300
- Subject: Re: Two minor issues
- References: <16C866B7-F5D2-4D95-922F-9D19ABC54D45@gmail.com>
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:
struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
if (tdep->wordsize == 4)
{
...
}
if (tdep->wordsize == 8)
{
...
}
--
[]'s
Thiago Jung Bauermann
IBM Linux Technology Center