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: pierre dot muller at ics-cnrs dot unistra dot fr (Pierre Muller)
- Cc: gdb-patches at sourceware dot org, tromey at redhat dot com, eliz at gnu dot org ('Eli Zaretskii')
- Date: Fri, 11 Jun 2010 19:37:44 +0200 (CEST)
- Subject: Re: [RFA-v3] Allow explicit 16 or 32 char in 'x /s'
Pierre Muller wrote:
> 2010-04-08 Pierre Muller <muller@ics.u-strasbg.fr>
>
> * gdb.base/charset.c (Strin16, String32): New variables.
> * gdb.base/charset.exp (gdb_test): Test correct display
> of 16 or 32 bit strings.
> +proc string_display { var_name set_prefix x_size x_type} {
> + gdb_test "set ${var_name} = ${set_prefix}\"Test String\\0with zeroes\""
This test required that malloc is present in the inferior; if target
code is statically linked, we need to make sure the routine gets
pulled in (just like other testcases already do).
Tested on spu-elf, committed to mainline.
Bye,
Ulrich
ChangeLog:
* gdb.base/charset.c (main): Make sure malloc gets linked in.
Index: gdb/testsuite/gdb.base/charset.c
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/charset.c,v
retrieving revision 1.13
diff -u -p -r1.13 charset.c
--- gdb/testsuite/gdb.base/charset.c 21 Apr 2010 23:21:04 -0000 1.13
+++ gdb/testsuite/gdb.base/charset.c 11 Jun 2010 16:43:07 -0000
@@ -120,6 +120,11 @@ int main ()
set_debug_traps();
breakpoint();
#endif
+
+ /* charset.exp wants to allocate memory for constants. So make sure malloc
+ gets linked into the program. */
+ malloc (1);
+
/* Initialize ascii_string. */
init_string (ascii_string,
120,
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com