This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch, testsuite] further robustify gdb.base/bp-permanent.exp
- From: Pedro Alves <palves at redhat dot com>
- To: Sandra Loosemore <sandra at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Mon, 03 Aug 2015 14:21:55 +0100
- Subject: Re: [patch, testsuite] further robustify gdb.base/bp-permanent.exp
- Authentication-results: sourceware.org; auth=none
- References: <55B9A29E dot 4040305 at codesourcery dot com>
On 07/30/2015 05:05 AM, Sandra Loosemore wrote:
> When I was testing the Nios II R2 patch I posted earlier today, I saw a
> lot of failures from gdb.base/bp-permanent.exp. Upon investigation, I
> realized that this was a due to a quirk of the simulator we have
> available. Apparently, its execution engine maintains its own view of
> the .text section and breakpoints set through the debug interface are
> not visible to the running program. This means that the setup function
> in the program is stashing away a copy of the original NOP instruction
> at the breakpoint location, rather than the breakpoint instruction
> inserted by GDB, and when the .exp file thinks it is writing a permanent
> breakpoint in fact it is just telling the target to write a NOP to a
> location that already contains one. :-S
>
> Anyway, it is clear that if the program runs to termination instead of
> stopping where GDB expects, none of the remaining tests are going to do
> anything useful, so we might just as well report that the test is
> unsupported and return.
>
> OK to commit?
> + set test "permanent breakpoint causes random signal"
> + gdb_test_multiple "continue" $test {
> + -re "exited normally.*$gdb_prompt $" {
> + unsupported "failed to stop at permanent breakpoint"
> + return
> + }
> + -re "Program received signal SIGTRAP.*" {
This needs to end with "$gdb_prompt $" too.
OK with that change.
> + pass $test
> + }
> + }
>
> # Now set a breakpoint on top, thus creating a permanent breakpoint.
> gdb_breakpoint "$line_bp"
>
Thanks,
Pedro Alves