diff options
author | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-10-03 22:12:09 +0100 |
---|---|---|
committer | Andrew Burgess <andrew.burgess@embecosm.com> | 2019-11-27 12:02:02 +0000 |
commit | db5960b4d22761507097f816b1dac3bb56a22bb5 (patch) | |
tree | 211f7ccc6e5dd273b2c1f93e4dfc0a94f9e75d10 /gdb/mi/mi-symbol-cmds.c | |
parent | 7dc42066097ca6188ecd2c505d865e68d84998ee (diff) | |
download | gdb-db5960b4d22761507097f816b1dac3bb56a22bb5.zip gdb-db5960b4d22761507097f816b1dac3bb56a22bb5.tar.gz gdb-db5960b4d22761507097f816b1dac3bb56a22bb5.tar.bz2 |
gdb/mi: Add -symbol-info-modules command
Add '-symbol-info-modules', an MI version of the CLI 'info modules'
command.
gdb/ChangeLog:
* mi/mi-cmds.c (mi_cmds): Add 'symbol-info-modules' entry.
* mi/mi-cmds.h (mi_cmd_symbol_info_modules): Declare.
* mi/mi-symbol-cmds.c (mi_cmd_symbol_info_modules): New function.
* NEWS: Mention new MI command.
gdb/testsuite/ChangeLog:
* gdb.mi/mi-fortran-modules-2.f90: New file.
* gdb.mi/mi-fortran-modules.exp: New file.
* gdb.mi/mi-fortran-modules.f90: New file.
gdb/doc/ChangeLog:
* doc/gdb.texinfo (GDB/MI Symbol Query): Document new MI command
-symbol-info-modules.
Change-Id: Ibc618010d1d5f36ae8a8baba4fb9d9d724e62b0f
Diffstat (limited to 'gdb/mi/mi-symbol-cmds.c')
-rw-r--r-- | gdb/mi/mi-symbol-cmds.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/gdb/mi/mi-symbol-cmds.c b/gdb/mi/mi-symbol-cmds.c index f674dcf..10dd273 100644 --- a/gdb/mi/mi-symbol-cmds.c +++ b/gdb/mi/mi-symbol-cmds.c @@ -224,6 +224,43 @@ mi_cmd_symbol_info_functions (const char *command, char **argv, int argc) mi_info_functions_or_variables (FUNCTIONS_DOMAIN, argv, argc); } +/* Implement -symbol-inf-modules command. */ + +void +mi_cmd_symbol_info_modules (const char *command, char **argv, int argc) +{ + const char *regexp = nullptr; + + enum opt + { + NAME_REGEXP_OPT + }; + static const struct mi_opt opts[] = + { + {"-name", NAME_REGEXP_OPT, 1}, + { 0, 0, 0 } + }; + + int oind = 0; + char *oarg = nullptr; + + while (1) + { + int opt = mi_getopt ("-symbol-info-modules", argc, argv, opts, + &oind, &oarg); + if (opt < 0) + break; + switch ((enum opt) opt) + { + case NAME_REGEXP_OPT: + regexp = oarg; + break; + } + } + + mi_symbol_info (MODULES_DOMAIN, regexp, nullptr, true); +} + /* Implement -symbol-info-types command. */ void |