This is the mail archive of the gdb-prs@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cli/1616: readline macro expansion doesn't work correctly


>Number:         1616
>Category:       cli
>Synopsis:       readline macro expansion doesn't work correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 20 16:48:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator:     dick.streefland@altium.nl
>Release:        gdb-6.1
>Organization:
>Environment:
Debian sarge. Gdb is dynamically linked against libreadline.so.4, but the readline version included in the source distribution shows the same behavior.
>Description:
A readline macro doesn't expand until you press another key. The macro buffer is not read until the next input event.
>How-To-Repeat:
Define the following macro in your ~/.inputrc:

  "\C-A": "ABC"

Start gdb, and press control-A. The macro expansion "ABC" will not appear. Now press another key, and the "ABC" appears.
>Fix:
The attached patch fixes the problem for me, but perhaps this needs to be fixed in readline instead?
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="gdb-6.1-macro.diff"
Content-Disposition: inline; filename="gdb-6.1-macro.diff"

--- gdb-6.1/gdb/event-top.c.orig	2004-02-28 19:04:36.000000000 +0100
+++ gdb-6.1/gdb/event-top.c	2004-04-20 17:54:46.000000000 +0200
@@ -164,6 +164,12 @@ static void
 rl_callback_read_char_wrapper (gdb_client_data client_data)
 {
   rl_callback_read_char ();
+  while (rl_executing_macro)
+    {
+      immediate_quit++;
+      rl_callback_read_char ();
+      immediate_quit--;
+    }
   if (after_char_processing_hook)
     (*after_char_processing_hook) ();
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]