Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] Allow use of breakpoint commands inside `if' or `while'
Date: Sat, 13 Jan 2007 17:21:00 -0000	[thread overview]
Message-ID: <ur6tyhmgg.fsf@gnu.org> (raw)
In-Reply-To: <usleehmwi.fsf@gnu.org> (message from Eli Zaretskii on Sat, 13 	Jan 2007 19:11:41 +0200)

> Date: Sat, 13 Jan 2007 19:11:41 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> 
> (I will post an initial attempt to add a test for this in a moment.)

Here it is.  It is admittedly inelegant; in particular, the
diagnostics for a GDB that fails the test is not very smart, and one
of the two tests isn't counted in the sum of failed tests, although it
does fail.  Hopefully, someone more fluent with Expect will be able to
improve on the test (I think Daniel offered help back when I first
reported this).

--- testsuite/gdb.base/commands.exp.~0	2007-01-09 12:59:09.000000000 -0500
+++ testsuite/gdb.base/commands.exp	2007-01-13 12:00:18.912682122 -0500
@@ -618,6 +618,23 @@
     file delete file3
 }
 
+proc breakpoint_commands_in_if_command_test {} {
+    if [target_info exists noargs] { 
+        verbose "Skipping breakpoint_commands_in_if_command_test because of noargs."
+        return
+    }
+
+    gdb_test "set \$tem = 1" "" "set \$tem in breakpoint_commands_in_if_command_test"
+    delete_breakpoints
+    gdb_test "if \$tem == 2\nbreak main\nelse\nbreak factorial\ncommands\nsilent\nset \$tem = 3\n\continue\nend\nend" \
+	    "Breakpoint \[0-9\]+ at .*: file .*/run.c, line \[0-9\]+\." \
+	    "breakpoint in else condition"
+    delete_breakpoints
+    gdb_test "if \$tem == 1\nbreak main\nelse\nbreak factorial\ncommands\nsilent\nset \$tem = 3\n\continue\nend\nend" \
+	    "Breakpoint \[0-9\]+ at .*: file .*/run.c, line \[0-9\]+\." \
+	    "breakpoint in if condition"
+}
+
 gdbvar_simple_if_test
 gdbvar_simple_while_test
 gdbvar_complex_if_while_test
@@ -635,3 +652,4 @@
 temporary_breakpoint_commands
 stray_arg0_test
 recursive_source_test
+breakpoint_commands_in_if_command_test


  reply	other threads:[~2007-01-13 17:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-13 14:48 Eli Zaretskii
2006-01-13 15:32 ` Daniel Jacobowitz
2006-01-13 16:02   ` Eli Zaretskii
2006-01-14 15:49     ` Daniel Jacobowitz
2006-01-14 16:23       ` Eli Zaretskii
2006-01-14 16:28         ` Daniel Jacobowitz
2006-01-15  4:29           ` Eli Zaretskii
2006-01-15 10:42             ` Andreas Schwab
2007-01-13 17:11 ` Eli Zaretskii
2007-01-13 17:21   ` Eli Zaretskii [this message]
2007-01-20 20:34     ` Daniel Jacobowitz
2007-01-27 12:24       ` Eli Zaretskii
2007-01-29 16:21         ` Daniel Jacobowitz
2007-01-20 20:04   ` Daniel Jacobowitz
2007-01-27 12:31     ` 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=ur6tyhmgg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=gdb-patches@sources.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