${testfile}-hello.c \
${testfile}-world-dbg.S \
${testfile}-world.c]
-set flags \
- [list \
- "nodebug" \
- "additional_flags=\"-DHELLO_START=$hello_start\"" \
- "additional_flags=\"-DHELLO_END=$hello_start + $hello_len\"" \
- "additional_flags=\"-DWORLD_START=$world_start\"" \
- "additional_flags=\"-DWORLD_END=$world_start + $world_len\""]
+
+set flags {}
+lappend flags nodebug
+lappend flags additional_flags=[quote_for_host -DHELLO_START=$hello_start]
+lappend flags additional_flags=[quote_for_host -DHELLO_END=$hello_start \
+ + $hello_len]
+lappend flags additional_flags=[quote_for_host -DWORLD_START=$world_start]
+lappend flags additional_flags=[quote_for_host -DWORLD_END=$world_start \
+ + $world_len]
+
set executable ${testfile}
if {[build_executable ${testfile}.exp ${executable} $sources $flags] == -1} {
return -1
"${srcdir}/${subdir}/${srcfile2} ${srcdir}/${subdir}/${srcfile3}"] \
func_loopfb_start func_loopfb_len
-set flags \
- [list \
- "additional_flags=\"-DFUNC_NOFB_START=$func_nofb_start\"" \
- "additional_flags=\"-DFUNC_NOFB_END=$func_nofb_start + $func_nofb_len\"" \
- "additional_flags=\"-DFUNC_LOOPFB_START=$func_loopfb_start\"" \
- "additional_flags=\"-DFUNC_LOOPFB_END=$func_loopfb_start + $func_loopfb_len\""]
+set flags {}
+lappend flags \
+ additional_flags=[quote_for_host -DFUNC_NOFB_START=$func_nofb_start]
+lappend flags \
+ additional_flags=[quote_for_host -DFUNC_NOFB_END=$func_nofb_start \
+ + $func_nofb_len]
+lappend flags \
+ additional_flags=[quote_for_host -DFUNC_LOOPFB_START=$func_loopfb_start]
+lappend flags \
+ additional_flags=[quote_for_host -DFUNC_LOOPFB_END=$func_loopfb_start \
+ + $func_loopfb_len]
+
set executable ${testfile}
if { [prepare_for_testing_full "failed to prepare" \
return [string map $map $str]
}
+# Add double quotes around ARGS, sufficiently escaped for use on host
+# commandline.
+
+proc quote_for_host { args } {
+ set str [join $args]
+ if { [is_remote host] } {
+ set str [join [list {\"} $str {\"}] ""]
+ } else {
+ set str [join [list {"} $str {"}] ""]
+ }
+ return $str
+}
+
# Compile source files specified by SOURCE into a binary of type TYPE at path
# DEST. gdb_compile is implemented using DejaGnu's target_compile, so the type
# parameter and most options are passed directly to it.