]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: remove core file name from 'maint info program-spaces'
authorAndrew Burgess <aburgess@redhat.com>
Wed, 10 Sep 2025 09:32:48 +0000 (10:32 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Thu, 2 Oct 2025 18:25:43 +0000 (19:25 +0100)
I'm currently working towards a goal of moving the core file BFD out
of program_space and into core_target.  I believe this is a good
change to make as the core_target already holds a lot of state that is
parsed from the core file BFD, so storing the parsed, structured,
information in a different location to the original core file BFD
doesn't make sense to me.

In preparation for this change, the 'maint info program-spaces'
command needs updating.  Currently this command lists the name of the
core file BFD that is loaded into each program space.

Once the core file moves into core_target then the core file really
becomes a property of the inferior.

We could try to retain the existing output by looking up which
inferior is active in a given program space, and find the core file
that way, however, I don't like this plan because GDB does support
shared program spaces, in theory, a target could exist where every
inferior shares a single program space.  Even on more common POSIX
targets, after a vfork the parent and child share a program space.

Now the vfork case clearly doesn't impact the core file case, and I
don't know if GDB _actually_ supports any shared program space targets
any more.... but still, I don't think we should try to retain the
existing behaviour.

So, this commit removes the core file name from the 'maint info
program-spaces' output.  The next commit will add the core file name
back in a new home.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
Approved-By: Tom Tromey <tom@tromey.com>
gdb/NEWS
gdb/doc/gdb.texinfo
gdb/progspace.c

index 813443755af38212ef25e79c87169e22b3ad3783..ff66adb20ef384d8e2e2ab5ea2df9d87de9ea57a 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -33,6 +33,11 @@ maintenance test-remote-args ARGS
   Test splitting and joining of inferior arguments ARGS as they would
   be split and joined when being passed to a remote target.
 
+* Changed commands
+
+maintenance info program-spaces
+  This command no longer displays the core file name.
+
 * Changed remote packets
 
 single-inf-arg in qSupported
index dfe3493399c61b3c6f0ca454cc1e79af9b34450b..1e1893f02bc649819f252fb400ded3cad1b2a5bd 100644 (file)
@@ -3655,10 +3655,6 @@ the program space number assigned by @value{GDBN}
 the name of the executable loaded into the program space, with e.g.,
 the @code{file} command.
 
-@item
-the name of the core file loaded into the program space, with e.g.,
-the @code{core-file} command.
-
 @end enumerate
 
 @noindent
@@ -3671,7 +3667,7 @@ example, the list of inferiors bound to the program space.
 
 @smallexample
 (@value{GDBP}) maint info program-spaces
-  Id   Executable        Core File
+  Id   Executable
 * 1    hello
   2    goodbye
         Bound inferiors: ID 1 (process 21561)
@@ -3685,7 +3681,7 @@ the parent and child processes of a @code{vfork} call.  For example,
 
 @smallexample
 (@value{GDBP}) maint info program-spaces
-  Id   Executable        Core File
+  Id   Executable
 * 1    vfork-test
         Bound inferiors: ID 2 (process 18050), ID 1 (process 18045)
 @end smallexample
index 9928c16376f5c72ed4b981c9b407b092ea1e4cfb..db8879a4121ce3b980aa9c8c6386639116977ac7 100644 (file)
@@ -303,11 +303,10 @@ print_program_space (struct ui_out *uiout, int requested)
   /* There should always be at least one.  */
   gdb_assert (count > 0);
 
-  ui_out_emit_table table_emitter (uiout, 4, count, "pspaces");
+  ui_out_emit_table table_emitter (uiout, 3, count, "pspaces");
   uiout->table_header (1, ui_left, "current", "");
   uiout->table_header (4, ui_left, "id", "Id");
   uiout->table_header (longest_exec_name, ui_left, "exec", "Executable");
-  uiout->table_header (17, ui_left, "core", "Core File");
   uiout->table_body ();
 
   for (struct program_space *pspace : program_spaces)
@@ -332,12 +331,6 @@ print_program_space (struct ui_out *uiout, int requested)
       else
        uiout->field_skip ("exec");
 
-      if (pspace->cbfd != nullptr)
-       uiout->field_string ("core", bfd_get_filename (pspace->cbfd.get ()),
-                            file_name_style.style ());
-      else
-       uiout->field_skip ("core");
-
       /* Print extra info that doesn't really fit in tabular form.
         Currently, we print the list of inferiors bound to a pspace.
         There can be more than one inferior bound to the same pspace,