/* MI Command Set - file commands.
- Copyright (C) 2000-2021 Free Software Foundation, Inc.
+ Copyright (C) 2000-2024 Free Software Foundation, Inc.
Contributed by Cygnus Solutions (a Red Hat company).
This file is part of GDB.
#include "symtab.h"
#include "source.h"
#include "objfiles.h"
-#include "psymtab.h"
#include "solib.h"
#include "solist.h"
-#include "gdb_regex.h"
+#include "gdbsupport/gdb_regex.h"
/* Return to the client the absolute path and line number of the
current file being executed. */
void
-mi_cmd_file_list_exec_source_file (const char *command, char **argv, int argc)
+mi_cmd_file_list_exec_source_file (const char *command,
+ const char *const *argv, int argc)
{
struct symtab_and_line st;
struct ui_out *uiout = current_uiout;
uiout->field_string ("fullname", symtab_to_fullname (st.symtab));
uiout->field_signed ("macro-info",
- COMPUNIT_MACRO_TABLE (SYMTAB_COMPUNIT (st.symtab)) != NULL);
+ st.symtab->compunit ()->macro_table () != NULL);
}
/* Implement -file-list-exec-source-files command. */
void
-mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
+mi_cmd_file_list_exec_source_files (const char *command,
+ const char *const *argv, int argc)
{
enum opt
{
/* Parse arguments. */
int oind = 0;
- char *oarg;
+ const char *oarg;
bool group_by_objfile = false;
bool match_on_basename = false;
/* See mi-cmds.h. */
void
-mi_cmd_file_list_shared_libraries (const char *command, char **argv, int argc)
+mi_cmd_file_list_shared_libraries (const char *command,
+ const char *const *argv, int argc)
{
struct ui_out *uiout = current_uiout;
const char *pattern;
/* Print the table header. */
ui_out_emit_list list_emitter (uiout, "shared-libraries");
- for (struct so_list *so : current_program_space->solibs ())
+ for (const solib &so : current_program_space->solibs ())
{
- if (so->so_name[0] == '\0')
+ if (so.so_name.empty ())
continue;
- if (pattern != NULL && !re_exec (so->so_name))
+
+ if (pattern != nullptr && !re_exec (so.so_name.c_str ()))
continue;
ui_out_emit_tuple tuple_emitter (uiout, NULL);