From: Daniel Jacobowitz <drow@false.org>
To: Nick Roberts <nickrob@snap.net.nz>, gdb-patches@sourceware.org
Subject: Re: PATCH: PR tui/2173: Arrow keys no longer works in breakpoint command list
Date: Sun, 24 Jun 2007 15:46:00 -0000 [thread overview]
Message-ID: <20070624154700.GA14862@caradoc.them.org> (raw)
In-Reply-To: <20070605132700.GA10720@caradoc.them.org>
On Tue, Jun 05, 2007 at 09:27:00AM -0400, Daniel Jacobowitz wrote:
> On Wed, Jun 06, 2007 at 12:55:55AM +1200, Nick Roberts wrote:
> > > > This change breaks the behaviour of annotations with commands that span
> > > > multiple lines, like if, while, etc:
> > >
> > > Sorry, I didn't even know we had special annotations for this (and the
> > > testsuite must not cover it)...
> >
> > Here's a test for gdb.base/annota3.exp. I can do the same for
> > gdb.base/annota1.exp and gdb.cp/annota3.exp, if needed.
>
> Thanks. This is OK once we fix the problem. I haven't gotten back to
> you about that yet because I want to figure out what other issues were
> solved by the original patch - there were several. But I've been on
> vacation and I'm in a mad rush at home now, so it may be a bit longer.
Nick, does this work for emacs? It fixes the testcase (which I
updated to fail and not time out for broken GDBs).
--
Daniel Jacobowitz
CodeSourcery
2007-06-24 Daniel Jacobowitz <dan@codesourcery.com>
* top.c (gdb_readline_wrapper_line): Call rl_callback_handler_remove.
(struct gdb_readline_wrapper_cleanup): Remove prompt_orig.
(gdb_readline_wrapper_cleanup): Do not reset the prompt.
(gdb_readline_wrapper): Do not save the prompt. Pass our prompt
to display_gdb_prompt.
2007-06-24 Nick Roberts <nickrob@snap.net.nz>
Daniel Jacobowitz <dan@codesourcery.com>
* gdb.base/annota3.exp: Test for if construct.
Index: top.c
===================================================================
RCS file: /cvs/src/src/gdb/top.c,v
retrieving revision 1.120
diff -u -p -r1.120 top.c
--- top.c 29 Mar 2007 18:55:01 -0000 1.120
+++ top.c 24 Jun 2007 15:42:02 -0000
@@ -751,12 +751,16 @@ gdb_readline_wrapper_line (char *line)
/* Prevent operate-and-get-next from acting too early. */
saved_after_char_processing_hook = after_char_processing_hook;
after_char_processing_hook = NULL;
+
+ /* Prevent parts of the prompt from being redisplayed if annotations
+ are enabled, and readline's state getting out of sync. */
+ if (async_command_editing_p)
+ rl_callback_handler_remove ();
}
struct gdb_readline_wrapper_cleanup
{
void (*handler_orig) (char *);
- char *prompt_orig;
int already_prompted_orig;
};
@@ -766,7 +770,6 @@ gdb_readline_wrapper_cleanup (void *arg)
struct gdb_readline_wrapper_cleanup *cleanup = arg;
rl_already_prompted = cleanup->already_prompted_orig;
- PROMPT (0) = cleanup->prompt_orig;
gdb_assert (input_handler == gdb_readline_wrapper_line);
input_handler = cleanup->handler_orig;
@@ -790,14 +793,12 @@ gdb_readline_wrapper (char *prompt)
cleanup->handler_orig = input_handler;
input_handler = gdb_readline_wrapper_line;
- cleanup->prompt_orig = get_prompt ();
- PROMPT (0) = prompt;
cleanup->already_prompted_orig = rl_already_prompted;
back_to = make_cleanup (gdb_readline_wrapper_cleanup, cleanup);
/* Display our prompt and prevent double prompt display. */
- display_gdb_prompt (NULL);
+ display_gdb_prompt (prompt);
rl_already_prompted = 1;
if (after_char_processing_hook)
Index: testsuite/gdb.base/annota3.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/annota3.exp,v
retrieving revision 1.12
diff -u -p -r1.12 annota3.exp
--- testsuite/gdb.base/annota3.exp 9 Jan 2007 17:59:09 -0000 1.12
+++ testsuite/gdb.base/annota3.exp 24 Jun 2007 15:42:02 -0000
@@ -99,7 +99,29 @@ gdb_expect_list "annotation set at level
"set annotate 3"
}
-
+#
+# if construct:
+#
+send_gdb "if 1\n"
+gdb_expect {
+ -re "^if 1\r\n\r\n\032\032post-prompt\r\n\r\n\032\032pre-commands\r\n >\r\n\032\032commands\r\n$" {
+ pass "start if construct"
+ }
+ -re ".*\032\032commands\r\n" {
+ fail "start if construct"
+ }
+ timeout { fail "start if construct (timeout)" }
+}
+send_gdb "end\n"
+gdb_expect {
+ -re "^end\r\n\r\n\032\032post-commands\r\n$gdb_prompt$" {
+ pass "end if construct"
+ }
+ -re ".*$gdb_prompt$" {
+ fail "end if construct"
+ }
+ timeout { fail "end if construct (timeout)" }
+}
#
# info break:
#
next prev parent reply other threads:[~2007-06-24 15:46 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <18019.18081.448928.93993@kahikatea.snap.net.nz>
[not found] ` <20070604010633.GA927@caradoc.them.org>
2007-06-05 12:56 ` Nick Roberts
2007-06-05 13:27 ` Daniel Jacobowitz
2007-06-24 15:46 ` Daniel Jacobowitz [this message]
2007-06-24 21:55 ` Nick Roberts
2007-07-01 22:38 ` Daniel Jacobowitz
2007-07-03 1:28 ` Nick Roberts
2007-07-03 3:03 ` Daniel Jacobowitz
2007-07-03 15:39 ` Daniel Jacobowitz
2007-06-26 13:49 ` Jan Kratochvil
2007-06-26 14:33 ` Daniel Jacobowitz
2008-03-21 20:34 ` Jan Kratochvil
2008-03-21 21:22 ` Daniel Jacobowitz
2008-03-21 21:26 ` Jan Kratochvil
2008-03-21 21:41 ` Daniel Jacobowitz
2006-11-21 21:32 H. J. Lu
2006-11-28 16:53 ` Daniel Jacobowitz
2006-11-28 17:09 ` H. J. Lu
2006-11-28 17:15 ` Daniel Jacobowitz
2006-12-02 18:44 ` H. J. Lu
2006-12-02 18:55 ` Daniel Jacobowitz
2006-12-02 18:59 ` Joel Brobecker
2006-12-02 19:17 ` Chet Ramey
2006-12-02 19:09 ` Chet Ramey
2006-12-02 22:15 ` H. J. Lu
2006-12-02 23:06 ` Daniel Jacobowitz
2006-12-03 5:25 ` Chet Ramey
2006-12-17 23:46 ` Jan Kratochvil
2006-12-18 20:09 ` Chet Ramey
2006-12-19 23:20 ` Jan Kratochvil
2006-12-26 6:00 ` Jan Kratochvil
2007-01-03 21:46 ` Daniel Jacobowitz
2007-01-03 21:47 ` 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=20070624154700.GA14862@caradoc.them.org \
--to=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=nickrob@snap.net.nz \
/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