Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: mec.gnu@mindspring.com (Michael Elizabeth Chastain)
To: gdb-patches@sources.redhat.com, jjohnstn@redhat.com
Subject: Re: [RFA]: pending breakpoint support  [2/3]
Date: Wed, 21 Jan 2004 22:20:00 -0000	[thread overview]
Message-ID: <20040121222104.6C14E4B104@berman.michael-chastain.com> (raw)

Hi Jeff,

This needs some work.

+gdb_test_multiple "b langs0" "break on nonexistent function in langs.exp" {
+	-re "Function \"langs0\" not defined\.$" {
+		pass "break on nonexistent function in langs.exp"
+	}
+	-re "Function \"langs0\" not defined\..*Make breakpoint pending.*" {
+		send_gdb "n\n"
+		pass "break on nonexistent function in langs.exp"
+	}
+	-re "Breakpoint .* (deferred).*" {
+		pass "break on nonexistent function in langs.exp"
+	}
+	-re ".*$gdb_prompt.*" {
+		fail "break on nonexistent function in langs.exp"
+	}
+	timeout { fail "break on nonexistent function in langs.exp" }
+}
 
All the arms of a gdb_test_muliple need to end in "$gdb_prompt $" (or
something) to match all the text of the output string.  A pattern like
"Breakpoint .* (deferred).*" will match some indeterminate amount of
text after "deferred", leading to nondeterministic results for the next
test.

"Make breakpoint pending" does not end in "$gdb_prompt $" but it
should end with something other than ".*" for the same reason.

You don't need a ".*$gdb_prompt $" or a "timeout" case;
gdb_test_multiple automatically provides those.

The '(' and ')' need to be escaped: "\\(deferred\\)".

How come "Breakpoint .* \\(deferred\\).*$gdb_prompt $" is a PASS?
The function does not exist, so shouldn't that be a FAIL?
Or do I not understand your work?

> Index: testsuite/gdb.base/pending.c
> Index: testsuite/gdb.base/pendshr.c

These file need copyright notices.
See break.c for a good copyright notice.

+gdb_test_multiple "break pendfunc1" "set pending breakpoint" {
+     -re ".*Make breakpoint pending.*$" {
+	    gdb_test_multiple "y" "set pending breakpoint" {
+		-re "Breakpoint.*pendfunc1.*pending.*$gdb_prompt $" {
+		pass "set pending breakpoint"
+		}
+	    }
+     }
+}

Same as before, don't put a ".*" at the end of a pattern.

> diff -u -p -r1.7 shlib-call.exp
> --- testsuite/gdb.base/shlib-call.exp	28 Sep 2002 01:12:04 -0000	1.7
> +++ testsuite/gdb.base/shlib-call.exp	21 Jan 2004 02:36:24 -0000

Add 2004 to the list of copyright years.

Michael C


             reply	other threads:[~2004-01-21 22:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-21 22:20 Michael Elizabeth Chastain [this message]
2004-01-21 22:58 ` J. Johnston
2004-01-21 23:14   ` J. Johnston
  -- strict thread matches above, loose matches on Subject: below --
2004-01-24  7:31 Michael Elizabeth Chastain
2004-01-24 10:36 ` Eli Zaretskii
2004-02-02 21:17   ` Jeff Johnston
2004-01-21 21:03 Jeff Johnston
2004-01-21 22:20 ` Daniel Jacobowitz
2004-01-21 23:12   ` J. Johnston
2004-01-22  0:20     ` Daniel Jacobowitz
2004-01-22  1:08       ` J. Johnston
2004-01-22 22:40         ` Daniel Jacobowitz
2004-01-23  1:06           ` J. Johnston
2004-01-23 15:01             ` Daniel Jacobowitz

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=20040121222104.6C14E4B104@berman.michael-chastain.com \
    --to=mec.gnu@mindspring.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jjohnstn@redhat.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