* gdb.base/charset-malloc.c: New file.
* gdb.base/charset.c (malloc_stub): New prototype.
(main): Call it instead of malloc itself.
* gdb.base/charset.exp: Use only prepare_for_testing.
(binfile): Remove the variable.
+2010-07-20 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Ulrich Weigand <uweigand@de.ibm.com>
+ Tom Tromey <tromey@redhat.com>
+
+ * gdb.base/charset-malloc.c: New file.
+ * gdb.base/charset.c (malloc_stub): New prototype.
+ (main): Call it instead of malloc itself.
+ * gdb.base/charset.exp: Use only prepare_for_testing.
+ (binfile): Remove the variable.
+
2010-07-13 Tom Tromey <tromey@redhat.com>
* gdb.python/py-prettyprint.c (struct arraystruct): New struct.
utf_32_string[i] = iso_8859_1_string[i] & 0xff;
}
+extern void malloc_stub (void);
+
int main ()
{
#ifdef usestubs
breakpoint();
#endif
- /* charset.exp wants to allocate memory for constants. So make sure malloc
- gets linked into the program. */
- malloc (1);
+ malloc_stub ();
/* Initialize ascii_string. */
init_string (ascii_string,
set testfile "charset"
set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
-if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
- untested "couldn't compile ${srcdir}/${subdir}/${srcfile}"
+set srcmallocfile ${testfile}-malloc.c
+if { [prepare_for_testing ${testfile}.exp ${testfile} [list $srcfile $srcmallocfile]] } {
return -1
}
-# Start with a fresh gdb.
-gdb_exit
-gdb_start
-gdb_reinitialize_dir $srcdir/$subdir
-gdb_load ${binfile}
-
# Parse the output from a `show charset' command. Return the host
# and target charset as a two-element list.
proc parse_show_charset_output {testname} {