aboutsummaryrefslogtreecommitdiff
path: root/gdb/top.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2024-02-19 10:53:54 +0000
committerAndrew Burgess <aburgess@redhat.com>2024-03-25 17:47:44 +0000
commitec483c2344f967708cfa71c84ef349b6951c1374 (patch)
tree8cb4e06eb3351118b83c618ee2430e5969fa6f0e /gdb/top.c
parent10c58fd8df4b3cbdadd536fbccb39ed111c594c2 (diff)
downloadgdb-ec483c2344f967708cfa71c84ef349b6951c1374.zip
gdb-ec483c2344f967708cfa71c84ef349b6951c1374.tar.gz
gdb-ec483c2344f967708cfa71c84ef349b6951c1374.tar.bz2
gdb: move more completion setup into completer.c
Move more setup of the readline global state relating to tab completion into completer.c out of top.c. Lots of the readline setup is done in init_main (top.c). This commit moves those bits of initialisation that relate to completion, and which are only set the one time, into completer.c. This does mean that readline initialisation is now done in multiple locations, some in init_main (top.c) and some in completer.c, but I think this is OK. The work done in init_main is the general readline setup. I think making static what can be made static, and having it all in one file, makes things easier to reason about. So I'm OK with having this split initialisation. The only completion related thing which is still setup in top.c is rl_completion_display_matches_hook. I've left this where it is for now as rl_completion_display_matches_hook is also updated in the tui code, and the display hook functions are not in completer.c anyway, so moving this initialisation to completer.c would not allow anything else to be made static. There should be no user visible changes after this commit.
Diffstat (limited to 'gdb/top.c')
-rw-r--r--gdb/top.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/gdb/top.c b/gdb/top.c
index 8df684e..0aeeb98 100644
--- a/gdb/top.c
+++ b/gdb/top.c
@@ -2139,9 +2139,6 @@ init_main (void)
write_history_p = 0;
/* Setup important stuff for command line editing. */
- rl_completion_word_break_hook = gdb_completion_word_break_characters;
- rl_attempted_completion_function = gdb_rl_attempted_completion_function;
- set_rl_completer_word_break_characters (default_word_break_characters ());
rl_completion_display_matches_hook = cli_display_match_list;
rl_readline_name = "gdb";
rl_terminal_name = getenv ("TERM");