summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephane Carrez <stcarrez@nerim.fr>2005-11-11 11:18:53 +0000
committerStephane Carrez <stcarrez@nerim.fr>2005-11-11 11:18:53 +0000
commitac15b9f35374962ccad01d01c92e3aa7114e778e (patch)
treea2361f825991401a6305b00268f1ac16a99459e0
parent218c1ee18e4d86c340e82f1453f1dc8f946ea53d (diff)
downloadgdb-ac15b9f35374962ccad01d01c92e3aa7114e778e.tar.gz
* gdb.asm/m68hc11.inc: Setup the data section.
* gdb.asm/asm-source.exp (m6811-*-*): Don't use the target board linker script for this test. (m6812-*-*): Likewise.
-rw-r--r--gdb/testsuite/ChangeLog7
-rw-r--r--gdb/testsuite/gdb.asm/asm-source.exp23
-rw-r--r--gdb/testsuite/gdb.asm/m68hc11.inc18
3 files changed, 45 insertions, 3 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 7edf6940fe1..bf009b47c7d 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2005-11-11 Stephane Carrez <stcarrez@nerim.fr>
+
+ * gdb.asm/m68hc11.inc: Setup the data section.
+ * gdb.asm/asm-source.exp (m6811-*-*): Don't use the target board linker
+ script for this test.
+ (m6812-*-*): Likewise.
+
2005-11-09 Randolph Chung <tausq@debian.org>
* gdb.base/structs2.exp: Update xfail to only trigger for gcc-3.x.
diff --git a/gdb/testsuite/gdb.asm/asm-source.exp b/gdb/testsuite/gdb.asm/asm-source.exp
index 5abe8eeae9e..ced0af7d0c2 100644
--- a/gdb/testsuite/gdb.asm/asm-source.exp
+++ b/gdb/testsuite/gdb.asm/asm-source.exp
@@ -80,11 +80,25 @@ switch -glob -- [istarget] {
}
"m6811-*-*" {
set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc11 -gdwarf-2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-mshort-double -m68hc11 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set debug-flags "-gdwarf-2"
+ # This asm test is specific and uses the linker directly.
+ # We must not use the target board linker script defined for other
+ # tests. Remove it and restore it later on.
+ set board [target_info name]
+ set old_ldscript [board_info $board ldscript]
+ unset_board_info "ldscript"
}
"m6812-*-*" {
set asm-arch m68hc11
- set asm-flags "-mshort-double -m68hc12 -gdwarf-2 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set asm-flags "-mshort-double -m68hc12 --no-warn -I${srcdir}/${subdir} -I${objdir}/${subdir}"
+ set debug-flags "-gdwarf-2"
+ # This asm test is specific and uses the linker directly.
+ # We must not use the target board linker script defined for other
+ # tests. Remove it and restore it later on.
+ set board [target_info name]
+ set old_ldscript [board_info $board ldscript]
+ set_board_info ldscript ""
}
"mips*-*" {
set asm-arch mips
@@ -226,6 +240,11 @@ if {[target_link "asmsrc1.o asmsrc2.o" "${binfile}" ${link-flags}] != "" } then
gdb_suppress_entire_file "Testcase compile failed, so all tests in this file will automatically fail."
}
+# Restore the target board linker script for HC11/HC12.
+if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } {
+ set_board_info ldscript $old_ldscript
+}
+
remote_exec build "mv asmsrc1.o asmsrc2.o ${objdir}/${subdir}"
diff --git a/gdb/testsuite/gdb.asm/m68hc11.inc b/gdb/testsuite/gdb.asm/m68hc11.inc
index 820908b277a..e8f5018c0b2 100644
--- a/gdb/testsuite/gdb.asm/m68hc11.inc
+++ b/gdb/testsuite/gdb.asm/m68hc11.inc
@@ -37,6 +37,22 @@
_.frame: .word 0
.previous
lds #0x2000
+ ; the linker script maps the data section in ROM (LMA) for its initial
+ ; content and in RAM (VMA) for its runtime value. We have to do
+ ; what the default crt0 does: copy the ROM part in RAM.
+ ; (otherwise any 'globalvar' appears uninitialized)
+ ldx #__data_image
+ ldy #__data_section_start
+ bra Start_map
+Loop:
+ ldaa 0,x
+ staa 0,y
+ inx
+ iny
+Start_map:
+ cpx #__data_image_end
+ blo Loop
+Done:
clr _.frame
clr _.frame+1
.endm
@@ -46,5 +62,5 @@ _.frame: .word 0
.macro gdbasm_datavar name value
.data
\name:
- .long \value
+ .word \value
.endm