Re: [rfa] New test sigbpt.{c,exp}

Andrew Cagney
2004-07-07T17:31:03Z

[-- Attachment #1: Type: text/plain, Size: 574 bytes --]

>> mec> How about:
>> mec> mec> (1) before running the program, 'disassemble bowler'
>> mec> (2) at the breakpoint, 'x/i $pc'
>> mec> check that the output of (2) matches one of the lines in (1)
>
>
> FYI, that's effectively what I did. It checks the $pc address against a table of valid instruction addresses. It doesn't match it fails, via gdb_test_multiple internals. All thats missing is a pattern to match any other pc address in bowler.

I've added the attached.

Andrew

> Trying to single-step after corrupting the $pc would be meaningless.
>
> Andrew

[-- Attachment #2: diffs --]
[-- Type: text/plain, Size: 728 bytes --]

2004-07-07 Andrew Cagney <cagney@gnu.org>

* gdb.base/sigbpt.exp (stepi_out): Check for a single step
corrupting the PC.

Index: gdb.base/sigbpt.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/sigbpt.exp,v
retrieving revision 1.1
diff -p -u -r1.1 sigbpt.exp
--- gdb.base/sigbpt.exp 6 Jul 2004 15:08:54 -0000 1.1
+++ gdb.base/sigbpt.exp 7 Jul 2004 17:28:50 -0000
@@ -184,6 +184,9 @@ proc stepi_out { name args } {
-re "pc *[after_segv] .*bowler.*$gdb_prompt $" {
kfail gdb/1702 "$test (skipped fault insn)"
}
+ -re "pc *0x\[a-z0-9\]* .*bowler.*$gdb_prompt $" {
+ kfail gdb/1702 "$test (corrupt pc)"
+ }
}

# Clear any breakpoints