mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-26 22:07:58 +08:00
fix up gdb.xml
This fixes the gdb.xml tests to be parallel-safe. 2013-11-04 Tom Tromey <tromey@redhat.com> * gdb.xml/tdesc-arch.exp: Use standard_output_file. Make downloads conditional on remote host. (set_arch): Likewise. * gdb.xml/tdesc-regs.exp: Use gdb_remote_download. (load_description): Use standard_output_file.
This commit is contained in:
@ -1,3 +1,11 @@
|
|||||||
|
2013-11-04 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* gdb.xml/tdesc-arch.exp: Use standard_output_file. Make
|
||||||
|
downloads conditional on remote host.
|
||||||
|
(set_arch): Likewise.
|
||||||
|
* gdb.xml/tdesc-regs.exp: Use gdb_remote_download.
|
||||||
|
(load_description): Use standard_output_file.
|
||||||
|
|
||||||
2013-11-04 Tom Tromey <tromey@redhat.com>
|
2013-11-04 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* gdb.gdb/selftest.exp: Use standard_output_file.
|
* gdb.gdb/selftest.exp: Use standard_output_file.
|
||||||
|
@ -60,17 +60,20 @@ proc set_arch { arch which } {
|
|||||||
global gdb_prompt
|
global gdb_prompt
|
||||||
global subdir
|
global subdir
|
||||||
|
|
||||||
set fd [open "$subdir/tdesc-arch.xml" w]
|
set filename [standard_output_file tdesc-arch.xml]
|
||||||
|
set fd [open $filename w]
|
||||||
puts $fd \
|
puts $fd \
|
||||||
"<target>
|
"<target>
|
||||||
<architecture>$arch</architecture>
|
<architecture>$arch</architecture>
|
||||||
</target>"
|
</target>"
|
||||||
close $fd
|
close $fd
|
||||||
remote_download host "${subdir}/tdesc-arch.xml" "tdesc-arch.xml"
|
if {[is_remote host]} {
|
||||||
|
set filename [remote_download host $filename tdesc-arch.xml]
|
||||||
|
}
|
||||||
|
|
||||||
# Anchor the test output, so that error messages are detected.
|
# Anchor the test output, so that error messages are detected.
|
||||||
set cmd "set tdesc filename tdesc-arch.xml"
|
set cmd "set tdesc filename $filename"
|
||||||
set msg "$cmd ($which architecture)"
|
set msg "set tdesc filename tdesc-arch.xml ($which architecture)"
|
||||||
set cmd_regex [string_to_regexp $cmd]
|
set cmd_regex [string_to_regexp $cmd]
|
||||||
gdb_test_multiple $cmd $msg {
|
gdb_test_multiple $cmd $msg {
|
||||||
-re "^$cmd_regex\r\n$gdb_prompt $" {
|
-re "^$cmd_regex\r\n$gdb_prompt $" {
|
||||||
@ -86,31 +89,32 @@ proc set_arch { arch which } {
|
|||||||
"The target architecture is set automatically \\(currently $arch\\)" \
|
"The target architecture is set automatically \\(currently $arch\\)" \
|
||||||
"$cmd ($which architecture)"
|
"$cmd ($which architecture)"
|
||||||
|
|
||||||
file delete "${subdir}/tdesc-arch.xml"
|
remote_file host delete $filename
|
||||||
remote_file host delete "tdesc-arch.xml"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
set_arch $arch1 first
|
set_arch $arch1 first
|
||||||
set_arch $arch2 second
|
set_arch $arch2 second
|
||||||
|
|
||||||
# Check an invalid architecture setting.
|
# Check an invalid architecture setting.
|
||||||
set fd [open "${subdir}/tdesc-arch.xml" w]
|
set filename [standard_output_file tdesc-arch.xml]
|
||||||
|
set fd [open $filename w]
|
||||||
puts $fd \
|
puts $fd \
|
||||||
"<target>
|
"<target>
|
||||||
<architecture>invalid</architecture>
|
<architecture>invalid</architecture>
|
||||||
</target>"
|
</target>"
|
||||||
close $fd
|
close $fd
|
||||||
remote_download host "$subdir/tdesc-arch.xml" "tdesc-arch.xml"
|
if {[is_remote host]} {
|
||||||
|
set filename [remote_download host $filename "tdesc-arch.xml"]
|
||||||
|
}
|
||||||
|
|
||||||
set cmd "set tdesc filename tdesc-arch.xml"
|
set cmd "set tdesc filename $filename"
|
||||||
gdb_test $cmd \
|
gdb_test $cmd \
|
||||||
"warning:.*Target description specified unknown architecture.*" \
|
"warning:.*Target description specified unknown architecture.*" \
|
||||||
"$cmd (invalid architecture)"
|
"set tdesc filename tdesc-arch.xml (invalid architecture)"
|
||||||
|
|
||||||
set cmd "show architecture"
|
set cmd "show architecture"
|
||||||
gdb_test $cmd \
|
gdb_test $cmd \
|
||||||
"The target architecture is set automatically \\(currently $default_arch\\)" \
|
"The target architecture is set automatically \\(currently $default_arch\\)" \
|
||||||
"$cmd (invalid architecture)"
|
"$cmd (invalid architecture)"
|
||||||
|
|
||||||
file delete "${subdir}/tdesc-arch.xml"
|
remote_file host delete $filename
|
||||||
remote_file host delete "tdesc-arch.xml"
|
|
||||||
|
@ -94,7 +94,8 @@ gdb_test "set tdesc file $srcdir/$subdir/single-reg.xml" \
|
|||||||
# Copy the core registers into the objdir if necessary, so that they
|
# Copy the core registers into the objdir if necessary, so that they
|
||||||
# will be found by <xi:include>.
|
# will be found by <xi:include>.
|
||||||
foreach src ${core-regs} {
|
foreach src ${core-regs} {
|
||||||
set file [remote_download host "$srcdir/../features/$regdir$src" "$src"]
|
set remote_filename($src) \
|
||||||
|
[gdb_remote_download host "$srcdir/../features/$regdir$src"]
|
||||||
}
|
}
|
||||||
|
|
||||||
# Similarly, we need to copy files under test into the objdir.
|
# Similarly, we need to copy files under test into the objdir.
|
||||||
@ -104,10 +105,13 @@ proc load_description { file errmsg } {
|
|||||||
global gdb_prompt
|
global gdb_prompt
|
||||||
global core-regs
|
global core-regs
|
||||||
global architecture
|
global architecture
|
||||||
|
global remote_filename
|
||||||
|
|
||||||
file delete "$subdir/regs.xml"
|
set regs_file [standard_output_file regs.xml]
|
||||||
|
|
||||||
|
file delete $regs_file
|
||||||
set ifd [open "$srcdir/$subdir/$file" r]
|
set ifd [open "$srcdir/$subdir/$file" r]
|
||||||
set ofd [open "$subdir/regs.xml" w]
|
set ofd [open $regs_file w]
|
||||||
while {[gets $ifd line] >= 0} {
|
while {[gets $ifd line] >= 0} {
|
||||||
if {[regexp {<xi:include href="core-regs.xml"/>} $line]} {
|
if {[regexp {<xi:include href="core-regs.xml"/>} $line]} {
|
||||||
if {! [string equal ${architecture} ""]} {
|
if {! [string equal ${architecture} ""]} {
|
||||||
@ -122,11 +126,13 @@ proc load_description { file errmsg } {
|
|||||||
}
|
}
|
||||||
close $ifd
|
close $ifd
|
||||||
close $ofd
|
close $ofd
|
||||||
remote_download host "$subdir/regs.xml" "regs.xml"
|
|
||||||
file delete "$subdir/regs.xml"
|
if {[is_remote host]} {
|
||||||
|
set regs_file [remote_download host "$subdir/regs.xml" "regs.xml"]
|
||||||
|
}
|
||||||
|
|
||||||
# Anchor the test output, so that error messages are detected.
|
# Anchor the test output, so that error messages are detected.
|
||||||
set cmd "set tdesc filename regs.xml"
|
set cmd "set tdesc filename [file tail $regs_file]"
|
||||||
set msg "set tdesc filename regs.xml - from $file"
|
set msg "set tdesc filename regs.xml - from $file"
|
||||||
set cmd_regex [string_to_regexp $cmd]
|
set cmd_regex [string_to_regexp $cmd]
|
||||||
gdb_test_multiple $cmd $msg {
|
gdb_test_multiple $cmd $msg {
|
||||||
@ -134,7 +140,15 @@ proc load_description { file errmsg } {
|
|||||||
pass $msg
|
pass $msg
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if {[is_remote host]} {
|
||||||
remote_file host delete "regs.xml"
|
remote_file host delete "regs.xml"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if {![is_remote host]} {
|
||||||
|
gdb_test "cd [standard_output_file {}]" "Working directory .*" \
|
||||||
|
"cd to directory holding xml"
|
||||||
}
|
}
|
||||||
|
|
||||||
load_description "extra-regs.xml" ""
|
load_description "extra-regs.xml" ""
|
||||||
@ -155,5 +169,5 @@ load_description "core-only.xml" ""
|
|||||||
gdb_test "ptype \$extrareg" "type = void"
|
gdb_test "ptype \$extrareg" "type = void"
|
||||||
|
|
||||||
foreach src ${core-regs} {
|
foreach src ${core-regs} {
|
||||||
remote_file host delete "$src"
|
remote_file host delete $remote_filename($src)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user