[Bug cli/34409] New: gdb recieves SIGTTIN when user uses readline macros

sandovin at mail dot ru via Gdb-prs <[email protected]>
Newsgroups gmane.comp.gdb.bugs.discuss
Message-ID <[email protected]/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=34409

            Bug ID: 34409
           Summary: gdb recieves SIGTTIN when user uses readline macros
           Product: gdb
           Version: 17.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: cli
          Assignee: unassigned at sourceware dot org
          Reporter: sandovin at mail dot ru
  Target Milestone: ---

steps to reproduce:

consider macro in ~/.inputrc 
(otherwise you can make kbd recorded equiv)

```
"\C-x\C-w": "n\rn\r"
```

start gdb with any program
hit any breakpoint
execute macro: \C-x\C-w

gdb would not update the prompt
and if you press any button
it would be stopped by SIGTTIN

---

right now to my understanding the anatomy is the following:
readline emits a line in a rl_callback_read_char, 
gdb_readline_wrapper_line removes a handler

but readline is still in RL_STATE_MACROINPUT
so it discards the macro content


```
          if (in_handler == 0 && rl_linefunc)
            _rl_callback_newline ();
        }
    }
  while (rl_pending_input || _rl_pushed_input_available () || RL_ISSTATE
(RL_STATE_MACROINPUT));

  CALLBACK_READ_RETURN ();
```

it calls rl_read_key, rl_read_key automatically pops macro
and then if macro is empty as well, attempts to read a char
from input stream via rl_getc

which leads to SIGTTIN

-- 
You are receiving this mail because:
You are on the CC list for the bug.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.