Fix gdb.base/attach.exp fails when gdb is configured --with-sysroot=/
I see some test fails in gdb.base/attach.exp when gdb is configured --with-sysroot=/. FAIL: gdb.base/attach.exp: attach2, with no file FAIL: gdb.base/attach.exp: load file manually, after attach2 (re-read) (got interactive prompt) FAIL: gdb.base/attach.exp: attach when process' a.out not in cwd If gdb is configured this way, sysroot is "/" in default, and if binfile is a absolute path, the regexp pattern $sysroot$escapedbinfile is incorrect. There are different ways to fix it, but I don't want to complicate the test, so I choose this naive way. gdb/testsuite: 2018-02-01 Yao Qi <yao.qi@linaro.org> * gdb.base/attach.exp (do_attach_tests): Set sysroot to "\[^\r\n\]*".
This commit is contained in:
parent
e99955cd8e
commit
d4d38844fa
|
@ -1,3 +1,8 @@
|
||||||
|
2018-02-01 Yao Qi <yao.qi@linaro.org>
|
||||||
|
|
||||||
|
* gdb.base/attach.exp (do_attach_tests): Set sysroot to
|
||||||
|
"\[^\r\n\]*".
|
||||||
|
|
||||||
2018-01-31 Nikola Prica <nikola.prica@rt-rk.com>
|
2018-01-31 Nikola Prica <nikola.prica@rt-rk.com>
|
||||||
|
|
||||||
* gdb.arch/powerpc-prologue-frame.s: New file.
|
* gdb.arch/powerpc-prologue-frame.s: New file.
|
||||||
|
|
|
@ -57,15 +57,12 @@ proc do_attach_tests {} {
|
||||||
# Figure out a regular expression that will match the sysroot,
|
# Figure out a regular expression that will match the sysroot,
|
||||||
# noting that the default sysroot is "target:", and also noting
|
# noting that the default sysroot is "target:", and also noting
|
||||||
# that GDB will strip "target:" from the start of filenames when
|
# that GDB will strip "target:" from the start of filenames when
|
||||||
# operating on the local filesystem
|
# operating on the local filesystem. However the default sysroot
|
||||||
set sysroot ""
|
# can be set via configure option --with-sysroot, which can be "/".
|
||||||
set test "show sysroot"
|
# If $binfile is a absolute path, so pattern
|
||||||
gdb_test_multiple $test $test {
|
# "$sysroot$escapedbinfile" below is wrong. Use [^\r\n]* to make
|
||||||
-re "The current system root is \"(.*)\"\..*${gdb_prompt} $" {
|
# $sysroot simple.
|
||||||
set sysroot $expect_out(1,string)
|
set sysroot "\[^\r\n\]*"
|
||||||
}
|
|
||||||
}
|
|
||||||
regsub "^target:" "$sysroot" "(target:)?" sysroot
|
|
||||||
|
|
||||||
# Start the program running and then wait for a bit, to be sure
|
# Start the program running and then wait for a bit, to be sure
|
||||||
# that it can be attached to.
|
# that it can be attached to.
|
||||||
|
|
Loading…
Reference in New Issue