Fix gdb.reverse failures on mingw32-hosted GDB
Commit Message
Hi,
I caught a few mingw32-specific failures for some of the gdb.reverse tests.
FAIL: gdb.reverse/consecutive-precsave.exp: reload precord save file
FAIL: gdb.reverse/finish-precsave.exp: reload precord save file
FAIL: gdb.reverse/until-precsave.exp: reload core file
FAIL: gdb.reverse/watch-precsave.exp: reload core file
FAIL: gdb.reverse/step-precsave.exp: reload core file
FAIL: gdb.reverse/break-precsave.exp: reload precord save file
FAIL: gdb.reverse/sigall-precsave.exp: reload precord save file
They happen for two reasons.
- mingw32 does not define SIGTRAP, so upon recording a core file, the
signal information will be missing, which in turn causes GDB to not
display the stopping signal when it loads the same core file. An earlier
message warns about this:
"warning: Signal SIGTRAP does not exist on this system."
- The testcase is crafted in a way that expects a pattern of the
stopping signal message instead of a successful core file read message.
The following patch fixes this by changing the old pattern to a more
reasonable one, while still ignoring the fact that mingw32-based GDB
does not record a SIGTRAP in a core file because it does not define it.
Sounds reasonable?
Regards,
Luis
Comments
Luis Machado <lgustavo@codesourcery.com> writes:
> The following patch fixes this by changing the old pattern to a more
> reasonable one, while still ignoring the fact that mingw32-based GDB
> does not record a SIGTRAP in a core file because it does not define
> it.
>
> Sounds reasonable?
>
> Regards,
> Luis
>
> 2014-11-11 Luis Machado <lgustavo@codesourcery.com>
>
> * gdb.reverse/break-precsave: Expect completion message for
> core file reads.
> * gdb.reverse/consecutive-precsave.exp: Likewise.
> * gdb.reverse/finish-precsave.exp: Likewise.
> * gdb.reverse/i386-precsave.exp: Likewise.
> * gdb.reverse/machinestate-precsave.exp: Likewise.
> * gdb.reverse/sigall-precsave.exp: Likewise.
> * gdb.reverse/solib-precsave.exp: Likewise.
> * gdb.reverse/step-precsave.exp: Likewise.
> * gdb.reverse/until-precsave.exp: Likewise.
> * gdb.reverse/watch-precsave.exp: Likewise.
This patch looks good to me.
On 11/13/2014 10:38 AM, Yao Qi wrote:
> Luis Machado <lgustavo@codesourcery.com> writes:
>
>> The following patch fixes this by changing the old pattern to a more
>> reasonable one, while still ignoring the fact that mingw32-based GDB
>> does not record a SIGTRAP in a core file because it does not define
>> it.
>>
>> Sounds reasonable?
>>
>> Regards,
>> Luis
>>
>> 2014-11-11 Luis Machado <lgustavo@codesourcery.com>
>>
>> * gdb.reverse/break-precsave: Expect completion message for
>> core file reads.
>> * gdb.reverse/consecutive-precsave.exp: Likewise.
>> * gdb.reverse/finish-precsave.exp: Likewise.
>> * gdb.reverse/i386-precsave.exp: Likewise.
>> * gdb.reverse/machinestate-precsave.exp: Likewise.
>> * gdb.reverse/sigall-precsave.exp: Likewise.
>> * gdb.reverse/solib-precsave.exp: Likewise.
>> * gdb.reverse/step-precsave.exp: Likewise.
>> * gdb.reverse/until-precsave.exp: Likewise.
>> * gdb.reverse/watch-precsave.exp: Likewise.
>
> This patch looks good to me.
>
Thanks. I just checked this in.
Luis
2014-11-11 Luis Machado <lgustavo@codesourcery.com>
* gdb.reverse/break-precsave: Expect completion message for
core file reads.
* gdb.reverse/consecutive-precsave.exp: Likewise.
* gdb.reverse/finish-precsave.exp: Likewise.
* gdb.reverse/i386-precsave.exp: Likewise.
* gdb.reverse/machinestate-precsave.exp: Likewise.
* gdb.reverse/sigall-precsave.exp: Likewise.
* gdb.reverse/solib-precsave.exp: Likewise.
* gdb.reverse/step-precsave.exp: Likewise.
* gdb.reverse/until-precsave.exp: Likewise.
* gdb.reverse/watch-precsave.exp: Likewise.
@@ -58,7 +58,7 @@ proc precsave_tests {} {
"Kill the program being debugged\\? \\(y or n\\) " "y"
gdb_test "record restore $precsave" \
- "Program terminated with signal .*" \
+ "Restored records from core file .*" \
"reload precord save file"
gdb_test "break foo" \
@@ -50,7 +50,7 @@ gdb_test "kill" "" "Kill process, prepare to debug log file" \
"Kill the program being debugged\\? \\(y or n\\) " "y"
gdb_test "record restore $precsave" \
- "Program terminated with signal .*" \
+ "Restored records from core file .*" \
"reload precord save file"
gdb_breakpoint foo
@@ -51,7 +51,7 @@ gdb_test "kill" "" "Kill process, prepare to debug log file" \
"Kill the program being debugged\\? \\(y or n\\) " "y"
gdb_test "record restore $precsave" \
- "Program terminated with signal .*" \
+ "Restored records from core file .*" \
"reload precord save file"
# Test finish from void func
@@ -68,7 +68,7 @@ gdb_test "kill" "" "Kill process, prepare to debug log file" \
"Kill the program being debugged\\? \\(y or n\\) " "y"
gdb_test "record restore $precsave" \
- "Program terminated with signal .*" \
+ "Restored records from core file .*" \
"reload precord save file"
gdb_test "step" "inc .eax.*" "step to inc eax 1st time"
@@ -76,7 +76,7 @@ gdb_test "kill" "" "Kill process, prepare to debug log file" \
"Kill the program being debugged\\? \\(y or n\\) " "y"
gdb_test "record restore $precsave" \
- "Program terminated with signal .*" \
+ "Restored records from core file .*" \
"reload prec save file"
# Proceed to end of main
@@ -278,7 +278,7 @@ gdb_test "kill" "" "Kill process, prepare to debug log file" \
"Kill the program being debugged\\? \\(y or n\\) " "y"
gdb_test "record restore $precsave" \
- "Program terminated with signal .*" \
+ "Restored records from core file .*" \
"reload precord save file"
# Signal handlers must be re-enabled
@@ -101,7 +101,7 @@ gdb_test "kill" "" "Kill process, prepare to debug log file" \
"Kill the program being debugged\\? \\(y or n\\) " "y"
gdb_test "record restore $precsave" \
- "Program terminated with signal .*" \
+ "Restored records from core file .*" \
"reload core file"
#
@@ -54,7 +54,7 @@ gdb_test "kill" "" "Kill process, prepare to debug log file" \
"Kill the program being debugged\\? \\(y or n\\) " "y"
gdb_test "record restore $precsave" \
- "Program terminated with signal .*" \
+ "Restored records from core file .*" \
"reload core file"
# plain vanilla step/next (no count)
@@ -70,7 +70,7 @@ gdb_test "kill" "" "Kill process, prepare to debug log file" \
"Kill the program being debugged\\? \\(y or n\\) " "y"
gdb_test "record restore $precsave" \
- "Program terminated with signal .*" \
+ "Restored records from core file .*" \
"reload core file"
# Verify that plain vanilla "until <location>" works.
@@ -51,7 +51,7 @@ gdb_test "kill" "" "Kill process, prepare to debug log file" \
"Kill the program being debugged\\? \\(y or n\\) " "y"
gdb_test "record restore $precsave" \
- "Program terminated with signal .*" \
+ "Restored records from core file .*" \
"reload core file"
# Only software watchpoints can be used in reverse