diff options
author | Pedro Alves <palves@redhat.com> | 2014-10-17 13:31:26 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2014-10-17 13:34:16 +0100 |
commit | 6c4486e63f7583ed85a0c72841f6ccceebbf858e (patch) | |
tree | 02307265129b92c560eea444a06f25d409959bf7 /gdb/python/py-evts.c | |
parent | 0ff33695eeedf3c2e8cdec8690ae4a10a66b3389 (diff) | |
download | binutils-6c4486e63f7583ed85a0c72841f6ccceebbf858e.zip binutils-6c4486e63f7583ed85a0c72841f6ccceebbf858e.tar.gz binutils-6c4486e63f7583ed85a0c72841f6ccceebbf858e.tar.bz2 |
PR gdb/17471: Repeating a background command makes it foreground
When we repeat a command, by just pressing <ret>, the input from the
previous command is reused for the new command invocation.
When an execution command strips the "&" out of its incoming argument
string, to detect background execution, we poke a '\0' directly to the
incoming argument string.
Combine both, and a repeat of a background command loses the "&".
This is actually only visible if args other than "&" are specified
(e.g., "c 1&" or "next 2&" or "c -a&"), as in the special case of "&"
alone (e.g. "c&") doesn't actually clobber the incoming string.
Fix this by making strip_bg_char return a new string instead of poking
a hole in the input string.
New test included.
Tested on x86_64 Fedora 20, native and gdbserver.
gdb/
2014-10-17 Pedro Alves <palves@redhat.com>
PR gdb/17471
* infcmd.c (strip_bg_char): Change prototype and rewrite. Now
returns a copy of the input.
(run_command_1, continue_command, step_1, jump_command)
(signal_command, until_command, advance_command, finish_command)
(attach_command): Adjust and install a cleanup to free the
stripped args.
gdb/testsuite/
2014-10-17 Pedro Alves <palves@redhat.com>
PR gdb/17471
* gdb.base/bg-execution-repeat.c: New file.
* gdb.base/bg-execution-repeat.exp: New file.
Diffstat (limited to 'gdb/python/py-evts.c')
0 files changed, 0 insertions, 0 deletions