Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* PATCH: PR tui/2173: Arrow keys no longer works in breakpoint command list
@ 2006-11-21 21:32 H. J. Lu
  2006-11-28 16:53 ` Daniel Jacobowitz
  0 siblings, 1 reply; 32+ messages in thread
From: H. J. Lu @ 2006-11-21 21:32 UTC (permalink / raw)
  To: GDB

The problem is callback in readline 5.1 is changed. When gdb readline
callback calls readline (), readline is really confused since although
it is called from gdb callback, it isn't really in callback state. This
kludge seems to work for me.


H.J.
----
2006-11-21  H.J. Lu  <hongjiu.lu@intel.com>

	PR tui/2173
	* top.c (gdb_readline_wrapper): Unset and reset RL_STATE_CALLBACK
	around readline if needed.

--- gdb/top.c.arrow	2006-07-21 07:46:53.000000000 -0700
+++ gdb/top.c	2006-11-21 13:20:04.000000000 -0800
@@ -724,6 +724,9 @@ The filename in which to record the comm
 char *
 gdb_readline_wrapper (char *prompt)
 {
+  char *line;
+  int in_callback;
+
   /* Set the hook that works in this case.  */
   if (after_char_processing_hook)
     {
@@ -731,7 +734,19 @@ gdb_readline_wrapper (char *prompt)
       after_char_processing_hook = NULL;
     }
 
-  return readline (prompt);
+  /* When we call readline, we have to make sure that readline isn't in
+     the callback state. Otherwise, it will get really confused.
+     PR tui/2173.  */
+  in_callback = RL_ISSTATE (RL_STATE_CALLBACK);
+  if (in_callback)
+    RL_UNSETSTATE (RL_STATE_CALLBACK);
+
+  line = readline (prompt);
+
+  if (in_callback)
+    RL_SETSTATE (RL_STATE_CALLBACK);
+
+  return line;
 }
 
 \f


^ permalink raw reply	[flat|nested] 32+ messages in thread
[parent not found: <18019.18081.448928.93993@kahikatea.snap.net.nz>]

end of thread, other threads:[~2008-03-21 21:41 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-21 21:32 PATCH: PR tui/2173: Arrow keys no longer works in breakpoint command list 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
     [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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox