]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/mi/mi-cmd-file.c
gdb: rename struct shobj -> struct solib
[thirdparty/binutils-gdb.git] / gdb / mi / mi-cmd-file.c
index 0970d369cc5a20f9f21c3410432294b5f1da5c96..95128a9ad6dc60e789fb8ad2c09bc8c3fcdda751 100644 (file)
@@ -1,5 +1,5 @@
 /* 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;
@@ -59,13 +59,14 @@ mi_cmd_file_list_exec_source_file (const char *command, char **argv, int argc)
   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
     {
@@ -83,7 +84,7 @@ mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
 
   /* Parse arguments.  */
   int oind = 0;
-  char *oarg;
+  const char *oarg;
 
   bool group_by_objfile = false;
   bool match_on_basename = false;
@@ -131,7 +132,8 @@ mi_cmd_file_list_exec_source_files (const char *command, char **argv, int argc)
 /* 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;
@@ -161,11 +163,12 @@ mi_cmd_file_list_shared_libraries (const char *command, char **argv, int argc)
   /* 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);