This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA]: Compile some gdb.base tests with -mshort for HC11/HC12


Hi!

Some gdb.base tests must be compiled with -mshort for HC11/HC12 because
otherwise they either don't compile/link (remote.c, call-ar-st.c), or they
fail due to gdb expecting a different behavior when passing a char as parameter
(they are passed as 16-bit whatever the size of int).

Can you approve this patch?

(tested by running the gdb testsuite for m6811-elf)

Thanks,
	Stephane

2003-02-24 Stephane Carrez <stcarrez at nerim dot fr>

	* gdb.base/callfuncs.exp: Compile with -mshort for HC11/HC12.
	* gdb.base/remote.exp: Likewise.
	* gdb.base/call-ar-st.exp: Likewise.
Index: gdb.base/callfuncs.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/callfuncs.exp,v
retrieving revision 1.10
diff -u -p -r1.10 callfuncs.exp
--- gdb.base/callfuncs.exp	4 Jan 2003 22:37:49 -0000	1.10
+++ gdb.base/callfuncs.exp	23 Feb 2003 23:11:50 -0000
@@ -32,7 +32,14 @@ set testfile "callfuncs"
 set srcfile ${testfile}.c
 set binfile ${objdir}/${subdir}/${testfile}
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+# Must compile callfuncs with 16-bit int on 68HC11 because a char is promoted
+# to 16-bit and not 32 (as gdb would expect when compiling with 32-bit int)
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } then {
+    set result [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-mshort}]
+} else {
+    set result [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}]
+}
+if { $result != "" } then {
      gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }
 
Index: gdb.base/remote.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/remote.exp,v
retrieving revision 1.3
diff -u -p -r1.3 remote.exp
--- gdb.base/remote.exp	17 Jul 2001 21:47:19 -0000	1.3
+++ gdb.base/remote.exp	23 Feb 2003 23:11:50 -0000
@@ -1,4 +1,4 @@
-#   Copyright 1999, 2001 Free Software Foundation, Inc.
+#   Copyright 1999, 2001, 2003 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -36,8 +36,14 @@ set binfile ${objdir}/${subdir}/${testfi
 
 gdb_start
 
-set result [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}]
-if {$result != "" } then {
+# Must compile remote.c with 16-bit int on 68HC11 because the remote.c
+# array must be small.
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } then {
+    set result [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-mshort}]
+} else {
+    set result [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}]
+}
+if { $result != "" } then {
     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }
 
Index: gdb.base/call-ar-st.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/call-ar-st.exp,v
retrieving revision 1.12
diff -u -p -r1.12 call-ar-st.exp
--- gdb.base/call-ar-st.exp	29 May 2002 02:23:20 -0000	1.12
+++ gdb.base/call-ar-st.exp	23 Feb 2003 23:11:51 -0000
@@ -1,4 +1,4 @@
-#   Copyright 1998, 1999, 2000, 2001
+#   Copyright 1998, 1999, 2000, 2001, 2003
 #   Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
@@ -37,7 +37,14 @@ if { [istarget "sparclet-*-*"] } {
     return 0;
 }
 
-if  { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } {
+# Must compile call-ar-st.c with 16-bit int on 68HC11 because it is
+# too large and don't link otherwise.
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } then {
+    set result [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-mshort}]
+} else {
+    set result [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}]
+}
+if  { $result != "" } {
     gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
 }
 

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]