This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] lib/mi-support.exp (mi_expect_stop): Make fullname= optional.
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Fri, 15 Jun 2012 15:03:09 -0700 (PDT)
- Subject: [patch] lib/mi-support.exp (mi_expect_stop): Make fullname= optional.
Hi.
I was seeing a failure in mi-solib.exp and traced it to the fact that
fullname=foo wasn't being emitted by gdb.
What gdb prints depends on the system library that is loaded and how
it was compiled. The presence of fullname= isn't germane to the regexp, so
this patch makes the fullname= parameter optional in the expected output.
Regression tested on amd64-linux.
I will check this in in a few days if there are no objections.
2012-06-15 Doug Evans <dje@google.com>
* lib/mi-support.exp (mi_expect_stop): Make fullname= optional,
and remove duplicated complex regexp.
Index: mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.111
diff -u -p -r1.111 mi-support.exp
--- mi-support.exp 14 Apr 2012 12:18:44 -0000 1.111
+++ mi-support.exp 15 Jun 2012 21:57:59 -0000
@@ -1075,17 +1075,19 @@ proc mi_expect_stop { reason func args f
set any "\[^\n\]*"
- verbose -log "mi_expect_stop: expecting: \\*stopped,${r}${a}${bn}frame=\{addr=\"$hex\",func=\"$func\",args=$args,(?:file=\"$any$file\",fullname=\"${fullname_syntax}$file\",line=\"$line\"|from=\"$file\")\}$after_stopped,thread-id=\"$decimal\",stopped-threads=$any\r\n($thread_selected_re|$breakpoint_re)*$prompt_re"
+ set expected_regexp "\\*stopped,${r}${a}${bn}frame=\{addr=\"$hex\",func=\"$func\",args=$args,(?:file=\"$any$file\"(,fullname=\"${fullname_syntax}$file\")?,line=\"($line)\"|from=\"$file\")\}$after_stopped,thread-id=\"$decimal\",stopped-threads=$any\r\n($thread_selected_re|$breakpoint_re)*$prompt_re"
+ verbose -log "mi_expect_stop: expecting: $expected_regexp"
+
gdb_expect {
- -re "\\*stopped,${r}${a}${bn}frame=\{addr=\"$hex\",func=\"$func\",args=$args,(?:file=\"$any$file\",fullname=\"${fullname_syntax}$file\",line=\"($line)\"|from=\"$file\")\}$after_stopped,thread-id=\"$decimal\",stopped-threads=$any\r\n($thread_selected_re|$breakpoint_re)*$prompt_re" {
+ -re $expected_regexp {
pass "$test"
- if {[array names expect_out "2,string"] != ""} {
- return $expect_out(2,string)
+ if {[array names expect_out "3,string"] != ""} {
+ return $expect_out(3,string)
}
# No debug info available but $file does match.
return 0
}
- -re "\\*stopped,${r}${a}${bn}frame=\{addr=\"$hex\",func=\"$any\",args=\[\\\[\{\]$any\[\\\]\}\],file=\"$any\",fullname=\"${fullname_syntax}$any\",line=\"\[0-9\]*\"\}$after_stopped,thread-id=\"$decimal\",stopped-threads=$any\r\n($thread_selected_re|$breakpoint_re)*$prompt_re" {
+ -re "\\*stopped,${r}${a}${bn}frame=\{addr=\"$hex\",func=\"$any\",args=\[\\\[\{\]$any\[\\\]\}\],file=\"$any\"(,fullname=\"${fullname_syntax}$any\")?,line=\"\[0-9\]*\"\}$after_stopped,thread-id=\"$decimal\",stopped-threads=$any\r\n($thread_selected_re|$breakpoint_re)*$prompt_re" {
verbose -log "got $expect_out(buffer)"
fail "$test (stopped at wrong place)"
return -1