From 50a5f1878e22b09ebea30ad60a2164b80af6efdb Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Fri, 20 Nov 2020 19:08:06 +0000 Subject: gdb: introduce new 'maint flush ' prefix command We currently have two flushing commands 'flushregs' and 'maint flush-symbol-cache'. I'm planning to add at least one more so I thought it might be nice if we bundled these together into one place. And so I created the 'maint flush ' command prefix. Currently there are two commands: (gdb) maint flush symbol-cache (gdb) maint flush register-cache Unfortunately, even though both of the existing flush commands are maintenance commands, I don't know how keen we about deleting existing commands for fear of breaking things in the wild. So, both of the existing flush commands 'maint flush-symbol-cache' and 'flushregs' are still around as deprecated aliases to the new commands. I've updated the testsuite to use the new command syntax, and updated the documentation too. gdb/ChangeLog: * NEWS: Mention new commands, and that the old commands are now deprecated. * cli/cli-cmds.c (maintenanceflushlist): Define. * cli/cli-cmds.h (maintenanceflushlist): Declare. * maint.c (_initialize_maint_cmds): Initialise maintenanceflushlist. * regcache.c: Add 'cli/cli-cmds.h' include. (reg_flush_command): Add header comment. (_initialize_regcache): Create new 'maint flush register-cache' command, make 'flushregs' an alias. * symtab.c: Add 'cli/cli-cmds.h' include. (_initialize_symtab): Create new 'maint flush symbol-cache' command, make old command an alias. gdb/doc/ChangeLog: * gdb.texinfo (Symbols): Document 'maint flush symbol-cache'. (Maintenance Commands): Document 'maint flush register-cache'. gdb/testsuite/ChangeLog: * gdb.base/c-linkage-name.exp: Update to use new 'maint flush ...' commands. * gdb.base/killed-outside.exp: Likewise. * gdb.opt/inline-bt.exp: Likewise. * gdb.perf/gmonster-null-lookup.py: Likewise. * gdb.perf/gmonster-print-cerr.py: Likewise. * gdb.perf/gmonster-ptype-string.py: Likewise. * gdb.python/py-unwind.exp: Likewise. --- gdb/cli/cli-cmds.c | 4 ++++ gdb/cli/cli-cmds.h | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'gdb/cli') diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 54822fa..88c83cd 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -151,6 +151,10 @@ struct cmd_list_element *maintenanceprintlist; struct cmd_list_element *maintenancechecklist; +/* Chain containing all defined "maintenance flush" subcommands. */ + +struct cmd_list_element *maintenanceflushlist; + struct cmd_list_element *setprintlist; struct cmd_list_element *showprintlist; diff --git a/gdb/cli/cli-cmds.h b/gdb/cli/cli-cmds.h index 1d64152..976cea0 100644 --- a/gdb/cli/cli-cmds.h +++ b/gdb/cli/cli-cmds.h @@ -89,6 +89,10 @@ extern struct cmd_list_element *maintenanceinfolist; extern struct cmd_list_element *maintenanceprintlist; +/* Chain containing all defined "maintenance flush" subcommands. */ + +extern struct cmd_list_element *maintenanceflushlist; + extern struct cmd_list_element *setprintlist; extern struct cmd_list_element *showprintlist; -- cgit v1.1