Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Pedro Alves <pedro@codesourcery.com>,
	gdb-patches@sourceware.org,
	       Ulrich Weigand <uweigand@de.ibm.com>
Subject: [patch] testsuite: Fix mi-solib.exp without debuginfos  [Re: [3/3] RFC: fix PR mi/8444]
Date: Fri, 02 Dec 2011 01:18:00 -0000	[thread overview]
Message-ID: <20111202011800.GA23680@host2.jankratochvil.net> (raw)
In-Reply-To: <201111251608.pAPG81oE002175@d06av02.portsmouth.uk.ibm.com>

On Fri, 25 Nov 2011 17:08:01 +0100, Ulrich Weigand wrote:
> The difference is that we only see a "from=" instead of
> "file="/"fullname="/"line=" as the PC is in a system library, and I don't
> have debug info installed for those ...

What about this patch?

I have checked the result of mi_expect_stop is not used anywhere so it is
questionable what it should return.

No regressions on {x86_64,x86_64-m32,i686}-fedora16-linux-gnu.


Thanks,
Jan


gdb/testsuite/
2011-12-02  Jan Kratochvil  <jan.kratochvil@redhat.com>

	Fix gdb.mi/mi-solib.exp without system debug info installed.
	* lib/mi-support.exp (mi_expect_stop): Accept FILE also for `from'
	expect attribute, return 0 for it.  Update comments.

--- a/gdb/testsuite/lib/mi-support.exp
+++ b/gdb/testsuite/lib/mi-support.exp
@@ -981,9 +981,10 @@ proc mi_detect_async {} {
 
 # Wait for MI *stopped notification to appear.
 # The REASON, FUNC, ARGS, FILE and LINE are regular expressions
-# to match against whatever is output in *stopped.  ARGS should
-# not include [] the list of argument is enclosed in, and other
-# regular expressions should not include quotes.
+# to match against whatever is output in *stopped.  FILE may also match
+# filename of a file without debug info.  ARGS should not include [] the
+# list of argument is enclosed in, and other regular expressions should
+# not include quotes.
 # If EXTRA is a list of one element, it's the regular expression
 # for output expected right after *stopped, and before GDB prompt.
 # If EXTRA is a list of two elements, the first element is for
@@ -991,9 +992,10 @@ proc mi_detect_async {} {
 # right after reason field.  The regex after reason should not include
 # the comma separating it from the following fields.
 # 
-# When we fail to match output at all, -1 is returned.  Otherwise,
-# the line at which we stop is returned.  This is useful when exact
-# line is not possible to specify for some reason -- one can pass
+# When we fail to match output at all, -1 is returned.  If FILE does
+# match and the target system has no debug info for FILE return 0.
+# Otherwise, the line at which we stop is returned.  This is useful when
+# exact line is not possible to specify for some reason -- one can pass
 # the .* or "\[0-9\]*" regexps for line, and then check the line
 # programmatically.
 #
@@ -1067,11 +1069,15 @@ proc mi_expect_stop { reason func args file line extra test } {
 
     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\"\}$after_stopped,thread-id=\"$decimal\",stopped-threads=$any\r\n($thread_selected_re|$breakpoint_re)*$prompt_re"
+    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"
     gdb_expect {
-	-re "\\*stopped,${r}${a}${bn}frame=\{addr=\"$hex\",func=\"$func\",args=$args,file=\"$any$file\",fullname=\"${fullname_syntax}$file\",line=\"($line)\"\}$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=\"$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" {
 	    pass "$test"
-            return $expect_out(2,string)
+	    if {[array names expect_out "2,string"] != ""} {
+		return $expect_out(2,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" {
             verbose -log "got $expect_out(buffer)"


  reply	other threads:[~2011-12-02  1:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-16 20:28 [3/3] RFC: fix PR mi/8444 Tom Tromey
2011-11-16 21:31 ` Pedro Alves
2011-11-17 16:41   ` Tom Tromey
2011-11-22 14:55     ` Pedro Alves
2011-11-22 21:22       ` Tom Tromey
2011-11-25 16:08         ` Ulrich Weigand
2011-12-02  1:18           ` Jan Kratochvil [this message]
2011-12-02 16:17             ` [patch] testsuite: Fix mi-solib.exp without debuginfos [Re: [3/3] RFC: fix PR mi/8444] Tom Tromey
2011-12-02 22:36               ` [commit] " Jan Kratochvil
2011-12-09 21:26             ` Tom Tromey
2011-12-09 21:54               ` Jan Kratochvil
2011-12-09 21:56                 ` Tom Tromey
2011-11-17  4:03 ` [3/3] RFC: fix PR mi/8444 Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111202011800.GA23680@host2.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=tromey@redhat.com \
    --cc=uweigand@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox