+2014-10-13 Miroslav Franc <mfranc@redhat.com>
+ Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ Fix "save breakpoints" for "catch" command.
+ * break-catch-sig.c (signal_catchpoint_print_recreate): Add trailing
+ newline.
+
2014-10-12 Miroslav Franc <mfranc@redhat.com>
Fix "save breakpoints" for "disable $bpnum" command.
+2014-10-13 Jan Kratochvil <jan.kratochvil@redhat.com>
+ Yao Qi <yao@codesourcery.com>
+
+ Fix "save breakpoints" for "catch" command.
+ * gdb.base/catch-signal.exp: Add gdb_breakpoint "main".
+ Remove -nonewline. Match also the added "main" line.
+
2014-10-12 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix "save breakpoints" for "disable $bpnum" command.
"set catchpoint '$arg' for printing"
gdb_test "info break" "$decimal.*catchpoint.*signal.*$desc.*" \
"info break for '$arg'"
+ gdb_breakpoint "main"
gdb_test "save breakpoints [standard_output_file bps.$i]" \
"Saved to file .*bps.$i.*" \
"save breakpoints for '$arg'"
set filename [remote_upload host [standard_output_file bps.$i] \
[standard_output_file bps-local.$i]]
set fd [open $filename]
- set contents [read -nonewline $fd]
+ set file_data [read $fd]
+ set data [split $file_data "\n"]
close $fd
if {$arg == ""} {
} else {
set pattern "catch signal $arg"
}
- if {[string match $pattern $contents]} {
- pass "results of save breakpoints for '$arg'"
- } else {
- fail "results of save breakpoints for '$arg'"
- }
+ gdb_assert {[expr [llength $data] == 3]} \
+ "Number of lines of save breakpoints for '$arg'"
+ # Check the first line.
+ gdb_assert {[string match $pattern [lindex $data 0]]} \
+ "1st line of save breakpoints for '$arg'"
+ # Check the second line.
+ gdb_assert {[string match "break main" [lindex $data 1]]} \
+ "2nd line of save breakpoints for '$arg'"
+ # Check the trailing newline.
+ gdb_assert {[string match "" [lindex $data 2]]} \
+ "Trailing newline of save breakpoints for '$arg'"
incr i
}