aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorAndrew Burgess <andrew.burgess@embecosm.com>2019-10-03 22:12:09 +0100
committerAndrew Burgess <andrew.burgess@embecosm.com>2019-11-27 12:02:02 +0000
commitdb5960b4d22761507097f816b1dac3bb56a22bb5 (patch)
tree211f7ccc6e5dd273b2c1f93e4dfc0a94f9e75d10 /gdb/mi
parent7dc42066097ca6188ecd2c505d865e68d84998ee (diff)
downloadgdb-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')
-rw-r--r--gdb/mi/mi-cmds.c1
-rw-r--r--gdb/mi/mi-cmds.h1
-rw-r--r--gdb/mi/mi-symbol-cmds.c37
3 files changed, 39 insertions, 0 deletions
diff --git a/gdb/mi/mi-cmds.c b/gdb/mi/mi-cmds.c
index df9f25f..85c15ec 100644
--- a/gdb/mi/mi-cmds.c
+++ b/gdb/mi/mi-cmds.c
@@ -154,6 +154,7 @@ static struct mi_cmd mi_cmds[] =
DEF_MI_CMD_MI ("symbol-info-functions", mi_cmd_symbol_info_functions),
DEF_MI_CMD_MI ("symbol-info-variables", mi_cmd_symbol_info_variables),
DEF_MI_CMD_MI ("symbol-info-types", mi_cmd_symbol_info_types),
+ DEF_MI_CMD_MI ("symbol-info-modules", mi_cmd_symbol_info_modules),
DEF_MI_CMD_CLI ("target-attach", "attach", 1),
DEF_MI_CMD_MI ("target-detach", mi_cmd_target_detach),
DEF_MI_CMD_CLI ("target-disconnect", "disconnect", 0),
diff --git a/gdb/mi/mi-cmds.h b/gdb/mi/mi-cmds.h
index c2fd7d3..30de780 100644
--- a/gdb/mi/mi-cmds.h
+++ b/gdb/mi/mi-cmds.h
@@ -95,6 +95,7 @@ extern mi_cmd_argv_ftype mi_cmd_stack_list_variables;
extern mi_cmd_argv_ftype mi_cmd_stack_select_frame;
extern mi_cmd_argv_ftype mi_cmd_symbol_list_lines;
extern mi_cmd_argv_ftype mi_cmd_symbol_info_functions;
+extern mi_cmd_argv_ftype mi_cmd_symbol_info_modules;
extern mi_cmd_argv_ftype mi_cmd_symbol_info_types;
extern mi_cmd_argv_ftype mi_cmd_symbol_info_variables;
extern mi_cmd_argv_ftype mi_cmd_target_detach;
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