From: Andrew Burgess <aburgess@redhat.com>
To: Guinevere Larsen <guinevere@redhat.com>, gdb-patches@sourceware.org
Cc: Guinevere Larsen <guinevere@redhat.com>
Subject: Re: [PATCH v2 6/8] gdb: Remove stabs support from XCOFF inferiors
Date: Fri, 07 Nov 2025 10:46:58 +0000 [thread overview]
Message-ID: <874ir65dct.fsf@redhat.com> (raw)
In-Reply-To: <20251020152853.28195-7-guinevere@redhat.com>
Guinevere Larsen <guinevere@redhat.com> writes:
> This commit is the second to last in the series fully removing support
> for stabs in GDB, removing it from XCOFF inferiors. According to IBM's
> AIX documentation[1], xcoff binaries can only have stabs or DWARF debug
> info, meaning removing stabs seems pretty trivial, as anything that
> isn't related to setting base information on the objfile or reading
> dwarf can be removed.
>
> The unfortunate part of this removal is that XCOFF minimal symbols are
> encoded in stabs, so if an inferior has not been compiled with dwarf
> debuginfo, GDB will only be able to do assembly-level debugging. Due to
> this, the xcoff reader now emits a warning if no dwarf is read, saying:
> "No usable debug information found". This change would also add a lot of
> regressions to to AIX, so the gdb_compile proc has been changed to not
> work when a test tries to compile a test with nodebug.
>
> As a sidenote, gdb-stabs.h can just be removed from rs6000-aix-nat, as
> none of the structs or macros defined in the header are used in the nat
> file, so that is an unnecessary include.
>
> This commit introduces some known regressions when testing GDB in AIX
> systems. The main ones are:
> * inferior function calls now crash with a corrupted stack. This seems
> to be some fault of dwarf in explaining how to correctly set the frame
> for a function.
> * fortran tests can't runto_main: the fortran compiler does not add any
> symbol for MAIN__ in the dwarf information, only in stabs, so the
> fortran_runto_main proc can't set the breakpoint correctly.
> * When dealing with c++ class methods, there are cases when we fail to
> properly recognize a method call as a new function.
> * When dealing with c++ virtual inheritance, GDB has issues finding a
> derived class's members when it has been downcast to a base class.
A colleague reported this build failure after this commit:
CXX gdb.o
../../../binutils-gdb/gdb/xcoffread.c: In function 'void enter_line_range(subfile*, unsigned int, unsigned int, CORE_ADDR, CORE_ADDR, unsigned int*)':
../../../binutils-gdb/gdb/xcoffread.c:573:44: error: 'this' pointer is null [-Werror=nonnull]
573 | addr += objfile->text_section_offset ();
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from ../../../binutils-gdb/gdb/xcoffread.c:43:
../../../binutils-gdb/gdb/objfiles.h:512:13: note: in a call to non-static member function 'CORE_ADDR objfile::text_section_offset() const'
512 | CORE_ADDR text_section_offset () const
| ^~~~~~~~~~~~~~~~~~~
../../../binutils-gdb/gdb/xcoffread.c:579:63: error: 'this' pointer is null [-Werror=nonnull]
579 | - objfile->text_section_offset ());
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
../../../binutils-gdb/gdb/objfiles.h:512:13: note: in a call to non-static member function 'CORE_ADDR objfile::text_section_offset() const'
512 | CORE_ADDR text_section_offset () const
| ^~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
This was building GDB on current Fedora rawhide, with
gcc-15.2.1-2.fc44.x86_64.
The compiler is being pretty insightful here. OBJFILE is initialised
within the function like this:
struct objfile *objfile = this_symtab_objfile;
And THIS_SYMTAB_OBJFILE is a static variable within this file that is
initialised to NULL.
After this commit, there is now no longer any way that
THIS_SYMTAB_OBJFILE can be set to a non-null value, so the above
warning/error seems legit.
This opens a bigger question (in my mind). Either the code in
xcoffread.c that depends on THIS_SYMTAB_OBJFILE needs deleting, or some
parts of this commit need restoring.
I've not had a chance to look into this yet, so don't currently have an
opinion either way.
Thanks,
Andrew
next prev parent reply other threads:[~2025-11-07 10:48 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-20 15:28 [PATCH v2 0/8] Remove stabs support from GDB Guinevere Larsen
2025-10-20 15:28 ` [PATCH v2 1/8] gdb: move some stabs functions to gdb/buildsym-legacy.h Guinevere Larsen
2025-10-20 16:25 ` Tom Tromey
2025-10-20 15:28 ` [PATCH v2 2/8] gdb/mdebug: Remove stabs support from mips inferiors Guinevere Larsen
2025-10-20 15:28 ` [PATCH v2 3/8] gdb: Remove stabs support from ELF files Guinevere Larsen
2025-10-20 15:28 ` [PATCH v2 4/8] gdb: Remove stabs support from dbx Guinevere Larsen
2025-10-20 15:28 ` [PATCH v2 5/8] gdb: Remove stabs support for COFF files Guinevere Larsen
2025-10-20 15:28 ` [PATCH v2 6/8] gdb: Remove stabs support from XCOFF inferiors Guinevere Larsen
2025-11-07 10:46 ` Andrew Burgess [this message]
2025-11-07 12:09 ` Guinevere Larsen
2025-11-07 14:46 ` Tom Tromey
2025-10-20 15:28 ` [PATCH v2 7/8] gdb: Fully remove stabs code from GDB Guinevere Larsen
2025-10-20 16:39 ` Eli Zaretskii
2025-10-20 19:12 ` Guinevere Larsen
2025-10-20 15:28 ` [PATCH v2 8/8] gdb: remove support for dbx " Guinevere Larsen
2025-10-21 19:14 ` [PATCH v2 0/8] Remove stabs support " Tom Tromey
2025-10-21 19:42 ` Guinevere Larsen
2025-10-22 9:48 ` Luis
2025-10-22 13:08 ` Tom Tromey
2025-10-22 13:19 ` Guinevere Larsen
2025-10-22 19:19 ` Luis
2025-10-23 0:58 ` Luis
2025-10-23 2:03 ` Andrew Pinski
2025-10-23 18:11 ` Simon Marchi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=874ir65dct.fsf@redhat.com \
--to=aburgess@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=guinevere@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox