This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Harden gdb.base/coredump-filter.exp
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: "Gustavo\, Luis" <luis_gustavo at mentor dot com>
- Cc: "'gdb-patches\ at sourceware dot org'" <gdb-patches at sourceware dot org>
- Date: Fri, 10 Apr 2015 09:06:43 +0100
- Subject: Re: [PATCH] Harden gdb.base/coredump-filter.exp
- Authentication-results: sourceware.org; auth=none
- References: <5526D4A1 dot 9090203 at mentor dot com>
Luis Gustavo <luis_gustavo@mentor.com> writes:
> diff --git a/gdb/testsuite/gdb.base/coredump-filter.exp b/gdb/testsuite/gdb.base/coredump-filter.exp
> index f3203be..4c6c6ed 100644
> --- a/gdb/testsuite/gdb.base/coredump-filter.exp
> +++ b/gdb/testsuite/gdb.base/coredump-filter.exp
> @@ -15,6 +15,12 @@
>
> standard_testfile
>
> +# This test is Linux-only.
> +if ![istarget *-*-linux*] then {
> + unsupported "coredump-filter.exp"
> + return -1
> +}
> +
> if { [prepare_for_testing "failed to prepare" $testfile $srcfile debug] } {
> untested "could not compile test program"
> return -1
> @@ -146,6 +152,11 @@ gdb_test_multiple "info inferiors" "getting inferior pid" {
> -re "process \($decimal\).*\r\n$gdb_prompt $" {
> set infpid $expect_out(1,string)
> }
> + -re "Remote target.*$gdb_prompt $" {
> + # If the target does not provide PID information (like QEMU), just bail
FAOD, QEMU here is QEMU user mode, isn't?
> + # out as the rest of the test may rely on it, giving spurious failures.
> + return -1
> + }
> }
We can just bail out if infpid is still "" after this gdb_test_multiple.
--
Yao (éå)