diff options
author | Pedro Alves <palves@redhat.com> | 2019-06-13 00:06:52 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2019-06-13 00:07:37 +0100 |
commit | 3844e605e61777555aed09ab8ce88db2da95bc0b (patch) | |
tree | 6efaa3b3e032c0672cdd9d07bf8b0fc122415e1f /gdb/completer.h | |
parent | 00b56dbe7016bc33f882525a47faab943fdeda9a (diff) | |
download | binutils-3844e605e61777555aed09ab8ce88db2da95bc0b.zip binutils-3844e605e61777555aed09ab8ce88db2da95bc0b.tar.gz binutils-3844e605e61777555aed09ab8ce88db2da95bc0b.tar.bz2 |
Fix latent bug with custom word point completers
Completion routines that use a custom word point, and that then
recurse into complete_line (e.g., if we make "thread apply" a custom
word point completer, and complete on the command passed as argument),
we stumble on this latent bug:
(gdb) thread apply all pri[TAB]
(gdb) thread apply all priprint
The problem is that there's a spot in complete_line_internal_1 that
rewinds the completion word but does not reflect that change in the
custom word point in the tracker. This patch fixes it.
gdb/ChangeLog:
2019-06-13 Pedro Alves <palves@redhat.com>
* completer.c (complete_line_internal_1): Rewind completion word
point.
(completion_tracker::advance_custom_word_point_by): Change
parameter type to int.
* completer.h (completion_tracker::advance_custom_word_point_by):
Likewise.
Diffstat (limited to 'gdb/completer.h')
-rw-r--r-- | gdb/completer.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/completer.h b/gdb/completer.h index 38a0132..27371b6 100644 --- a/gdb/completer.h +++ b/gdb/completer.h @@ -357,7 +357,7 @@ public: { m_custom_word_point = point; } /* Advance the custom word point by LEN. */ - void advance_custom_word_point_by (size_t len); + void advance_custom_word_point_by (int len); /* Whether to tell readline to skip appending a whitespace after the completion. See m_suppress_append_ws. */ |