This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] save breakpoints does not save signal catchpoints correctly
- From: Yao Qi <yao at codesourcery dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: <gdb-patches at sourceware dot org>, Miroslav Franc <mfranc at redhat dot com>
- Date: Thu, 9 Oct 2014 21:37:24 +0800
- Subject: Re: [patch] save breakpoints does not save signal catchpoints correctly
- Authentication-results: sourceware.org; auth=none
- References: <20141003203219 dot GA30562 at host2 dot jankratochvil dot net>
Jan Kratochvil <jan.kratochvil@redhat.com> writes:
The fix looks right to me. Just one comment on the test case...
> - set contents [read -nonewline $fd]
> + set contents [read $fd]
> close $fd
>
IWBN to split the contents into a list and match each element in the
list one by one, so that ...
> + set nl "\r?\n"
> if {$arg == ""} {
> - set pattern "catch signal"
> + set pattern "catch signal$nl"
> } else {
> - set pattern "catch signal $arg"
> + set pattern "catch signal $arg$nl"
> }
> - if {[string match $pattern $contents]} {
> + set pattern "${pattern}break main$nl"
> + if {[regexp "$pattern" $contents]} {
... the pattern can be simplified and we can still use "string match".
On the other hand, in this way, the test can be easily extended in the
future, for example, saving more breakpoints in the file.
--
Yao (éå)