This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] [PR tdep/17379] Fix internal-error when stack pointer is invalid
- From: Pedro Alves <palves at redhat dot com>
- To: Edjunior Barbosa Machado <emachado at linux dot vnet dot ibm dot com>, gdb-patches at sourceware dot org
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>, Sergio Durigan Junior <sergiodj at redhat dot com>
- Date: Fri, 12 Sep 2014 10:59:12 +0100
- Subject: Re: [PATCH] [PR tdep/17379] Fix internal-error when stack pointer is invalid
- Authentication-results: sourceware.org; auth=none
- References: <1410490007-19756-1-git-send-email-emachado at linux dot vnet dot ibm dot com>
On 09/12/2014 03:46 AM, Edjunior Barbosa Machado wrote:
> +# Run until SIGSEGV.
> +gdb_run_cmd
> +
> +gdb_expect {
> + -re "Program received signal SIGSEGV.*$gdb_prompt $" {
> + pass "run until SIGSEGV"
> + }
> + -re ".*$gdb_prompt $" {
> + fail "run until SIGSEGV"
> + }
> + timeout {
> + fail "run until SIGSEGV (timeout)"
> + }
> +}
gdb_expect should only be used when gdb_test or gdb_test_multiple
really can't be used. Please write instead:
gdb_run_cmd
set test "run until SIGSEGV"
gdb_test_multiple "" $test {
-re "Program received signal SIGSEGV.*$gdb_prompt $" {
pass $test
}
}
gdb_test_multiple will already issue a FAIL if it sees the prompt
or gets a timeout, and in addition will catch other problems,
like internal errors.
Thanks,
Pedro Alves