]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb/testsuite/
authorJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 20 Jul 2010 22:12:24 +0000 (22:12 +0000)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Tue, 20 Jul 2010 22:12:24 +0000 (22:12 +0000)
* 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.

gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/charset.c
gdb/testsuite/gdb.base/charset.exp

index 11e689f338dfec94d768b0d572ce838515210444..9e82cd3be4662360f4d8a560e0700af2a2114bf7 100644 (file)
@@ -1,3 +1,13 @@
+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.
index a7d64f229ca5cd08b9f5caf491c15a87aedcbb9a..5dafc90b938b98f0163110c7553a45a2118845bb 100644 (file)
@@ -114,6 +114,8 @@ init_utf32 ()
     utf_32_string[i] = iso_8859_1_string[i] & 0xff;
 }
 
+extern void malloc_stub (void);
+
 int main ()
 {
 #ifdef usestubs
@@ -121,9 +123,7 @@ int main ()
   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,
index 58418be28eedc18ab3b4cfb17692a6bb30456077..06391170f07aacbf13ecdb0bbfce8e9dc295618d 100644 (file)
@@ -27,18 +27,11 @@ if $tracelevel then {
 
 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} {