From: Andrew Burgess Date: Wed, 10 Sep 2025 09:32:48 +0000 (+0100) Subject: gdb: remove core file name from 'maint info program-spaces' X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ace1656dad5a9dea2163bf28917c1f74cd655c74;p=thirdparty%2Fbinutils-gdb.git gdb: remove core file name from 'maint info program-spaces' 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 Approved-By: Tom Tromey --- diff --git a/gdb/NEWS b/gdb/NEWS index 813443755af..ff66adb20ef 100644 --- 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 diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index dfe3493399c..1e1893f02bc 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -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 diff --git a/gdb/progspace.c b/gdb/progspace.c index 9928c16376f..db8879a4121 100644 --- a/gdb/progspace.c +++ b/gdb/progspace.c @@ -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,