This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA-v3] Allow explicit 16 or 32 char in 'x /s'
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: tromey at redhat dot com (Tom Tromey)
- Cc: pierre dot muller at ics-cnrs dot unistra dot fr (Pierre Muller), gdb-patches at sourceware dot org, eliz at gnu dot org ('Eli Zaretskii')
- Date: Mon, 5 Jul 2010 12:17:33 +0200 (CEST)
- Subject: Re: [RFA-v3] Allow explicit 16 or 32 char in 'x /s'
Tom Tromey wrote:
> >>>>> "Ulrich" =3D=3D Ulrich Weigand <uweigand@de.ibm.com> writes:
>
> Ulrich> This test required that malloc is present in the inferior; if target
> Ulrich> code is statically linked, we need to make sure the routine gets
> Ulrich> pulled in (just like other testcases already do).
>
> Ulrich> * gdb.base/charset.c (main): Make sure malloc gets linked in.
>
> With this patch I now get:
>
> Running ../../../src/gdb/testsuite/gdb.base/charset.exp ...
> gdb compile failed, ../../../src/gdb/testsuite/gdb.base/charset.c: In function 'main':
> ../../../src/gdb/testsuite/gdb.base/charset.c:126: warning: incompatible implicit declaration of built-in function 'malloc'
Huh, sorry about that.
> It isn't safe here to include <stdlib.h>, since this test intentionally
> defines its own "wchar_t".
>
> Adding:
>
> extern void *malloc (int);
>
> works for me, but it seems possibly problematic.
Yes, it really should be size_t, not int (and that may be a real issue
on some 64-bit systems). But if you cannot include standard headers,
you don't get size_t either ...
> Maybe adding -fno-builtin for gcc is the thing to do?
>
> I am not really sure what is best. Any other ideas?
Can we split the testcase so that the parts that require the
non-standard wchar_t definition are separate from the parts
that construct strings in the inferior?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com