Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Follow up to stabs deprecation - AIX regressions
@ 2025-02-13 12:25 Guinevere Larsen
  2025-02-13 16:48 ` Kevin Buettner
  0 siblings, 1 reply; 7+ messages in thread
From: Guinevere Larsen @ 2025-02-13 12:25 UTC (permalink / raw)
  To: gdb-patches

Hi all,

I've been working on the removal of stabs ahead of schedule, and testing 
what I could test.

I noticed that the debug experience in AIX is severely affected by the 
removal of stabs. The most noticeable things I've seen is:

* DWARF reading can sometimes fail in AIX. Currently, reading dwarf for 
xcoff inferiors is called on it's own, with no warning if dwarf fails 
(which probably makes sense, considering the default format in aix is 
still stabs). I added a warning when failing to read dwarf and noticed 
it being triggered on inferiors compiled with -gdwarf
* DWARF reading is also outdated. the dwarf2_xcoff_names struct is 
missing 4 section names based on IBM docs[1], the one I remember is 
.dwarnge.
* Dealing with C++ classes has 2 obvious issues: when a pointer of an 
inherited class is downcast, GDB is unable to find members of the 
original type (that should be accessible), and GDB doesn't quite 
understand class methods as functions - step will skip method calls - 
plus a few more issues ado with understanding inheritance, as tested in 
gdb.cp/casts.exp
* Fortran tests can't runto_main. This seems to be a compiler issue, as 
the fortran_runto_main identifies the main function as MAIN__, but 
examining the generated dwarf there is no symbol for that.
* You just can't call inferior functions by hand. Most of the time, it 
gets a segfault with a corrupted stack. Considering that this used to 
work when reading stabs, it feels like the dwarf isn't properly 
explaining something about the frame that GDB uses to create dummy 
frames for the hand call, and it looks like it'd require a lot of system 
knowledge to fix

I haven't looked too in-depth into all failures, this is the large-scale 
patterns and my best attempt at explaining why things are failing how 
they are. Considering the state that AIX was in before I started testing 
it (less than 40k passes, and simply compiling with dwarf we can move up 
to 74.5k), and considering that the current maintainer of AIX is Kevin - 
who from our conversations remembers very little of how xcoff and aix 
work - I don't think this would warrant delaying removing stabs, but I 
think we should be aware of it so that if folks are using AIX, or 
interested in fixing it, they have until the release of GDB 18 to get 
the regressions under control.

[1] 
https://www.ibm.com/docs/en/aix/7.3?topic=formats-xcoff-object-file-format

-- 
Cheers,
Guinevere Larsen
She/Her/Hers


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Follow up to stabs deprecation - AIX regressions
  2025-02-13 12:25 Follow up to stabs deprecation - AIX regressions Guinevere Larsen
@ 2025-02-13 16:48 ` Kevin Buettner
  2025-02-13 17:21   ` Guinevere Larsen
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Buettner @ 2025-02-13 16:48 UTC (permalink / raw)
  To: Guinevere Larsen; +Cc: gdb-patches

On Thu, 13 Feb 2025 09:25:44 -0300
Guinevere Larsen <guinevere@redhat.com> wrote:

> * DWARF reading can sometimes fail in AIX. Currently, reading dwarf for 
> xcoff inferiors is called on it's own, with no warning if dwarf fails 
> (which probably makes sense, considering the default format in aix is 
> still stabs). I added a warning when failing to read dwarf and noticed 
> it being triggered on inferiors compiled with -gdwarf

I assume that you mean that stabs is the default when compiling with
gcc.  Is stabs still also the default format for XLC (IBM Open XL C/C++) ?

> ... and considering that the current maintainer of AIX is Kevin ...

I'll update the MAINTAINERS file and remove my name from some areas.

Kevin


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Follow up to stabs deprecation - AIX regressions
  2025-02-13 16:48 ` Kevin Buettner
@ 2025-02-13 17:21   ` Guinevere Larsen
  2025-02-13 17:43     ` Kevin Buettner
  0 siblings, 1 reply; 7+ messages in thread
From: Guinevere Larsen @ 2025-02-13 17:21 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

On 2/13/25 1:48 PM, Kevin Buettner wrote:
> On Thu, 13 Feb 2025 09:25:44 -0300
> Guinevere Larsen <guinevere@redhat.com> wrote:
>
>> * DWARF reading can sometimes fail in AIX. Currently, reading dwarf for
>> xcoff inferiors is called on it's own, with no warning if dwarf fails
>> (which probably makes sense, considering the default format in aix is
>> still stabs). I added a warning when failing to read dwarf and noticed
>> it being triggered on inferiors compiled with -gdwarf
> I assume that you mean that stabs is the default when compiling with
> gcc.  Is stabs still also the default format for XLC (IBM Open XL C/C++) ?

Yes, sorry, I meant gcc. The compile farm had versions 10 and 12, both 
with the same behavior.

I don't think the compile farm has XLC compilers available for testing, 
or if they do I don't know how to use it, so I couldn't tell you...

-- 
Cheers,
Guinevere Larsen
She/Her/Hers


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Follow up to stabs deprecation - AIX regressions
  2025-02-13 17:21   ` Guinevere Larsen
@ 2025-02-13 17:43     ` Kevin Buettner
  2025-02-13 17:58       ` Guinevere Larsen
  0 siblings, 1 reply; 7+ messages in thread
From: Kevin Buettner @ 2025-02-13 17:43 UTC (permalink / raw)
  To: Guinevere Larsen; +Cc: gdb-patches

On Thu, 13 Feb 2025 14:21:01 -0300
Guinevere Larsen <guinevere@redhat.com> wrote:

> On 2/13/25 1:48 PM, Kevin Buettner wrote:
> > On Thu, 13 Feb 2025 09:25:44 -0300
> > Guinevere Larsen <guinevere@redhat.com> wrote:
> >  
> >> * DWARF reading can sometimes fail in AIX. Currently, reading dwarf for
> >> xcoff inferiors is called on it's own, with no warning if dwarf fails
> >> (which probably makes sense, considering the default format in aix is
> >> still stabs). I added a warning when failing to read dwarf and noticed
> >> it being triggered on inferiors compiled with -gdwarf  
>
> > I assume that you mean that stabs is the default when compiling with
> > gcc.  Is stabs still also the default format for XLC (IBM Open XL C/C++) ?  
> 
> Yes, sorry, I meant gcc. The compile farm had versions 10 and 12, both 
> with the same behavior.
> 
> I don't think the compile farm has XLC compilers available for testing, 
> or if they do I don't know how to use it, so I couldn't tell you...

I think it'd be good to find out XLC's preferred debug format.  If it
uses/prefers DWARF, that'd be a good argument for gcc (on AIX)
switching to DWARF for it's preferred format too.

Kevin


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Follow up to stabs deprecation - AIX regressions
  2025-02-13 17:43     ` Kevin Buettner
@ 2025-02-13 17:58       ` Guinevere Larsen
  2025-02-13 20:21         ` Simon Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: Guinevere Larsen @ 2025-02-13 17:58 UTC (permalink / raw)
  To: Kevin Buettner; +Cc: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 1846 bytes --]

On 2/13/25 2:43 PM, Kevin Buettner wrote:
> On Thu, 13 Feb 2025 14:21:01 -0300
> Guinevere Larsen<guinevere@redhat.com> wrote:
>
>> On 2/13/25 1:48 PM, Kevin Buettner wrote:
>>> On Thu, 13 Feb 2025 09:25:44 -0300
>>> Guinevere Larsen<guinevere@redhat.com> wrote:
>>>   
>>>> * DWARF reading can sometimes fail in AIX. Currently, reading dwarf for
>>>> xcoff inferiors is called on it's own, with no warning if dwarf fails
>>>> (which probably makes sense, considering the default format in aix is
>>>> still stabs). I added a warning when failing to read dwarf and noticed
>>>> it being triggered on inferiors compiled with -gdwarf
>>> I assume that you mean that stabs is the default when compiling with
>>> gcc.  Is stabs still also the default format for XLC (IBM Open XL C/C++) ?
>> Yes, sorry, I meant gcc. The compile farm had versions 10 and 12, both
>> with the same behavior.
>>
>> I don't think the compile farm has XLC compilers available for testing,
>> or if they do I don't know how to use it, so I couldn't tell you...
> I think it'd be good to find out XLC's preferred debug format.  If it
> uses/prefers DWARF, that'd be a good argument for gcc (on AIX)
> switching to DWARF for it's preferred format too.
>
> Kevin
>
I just looked over at the GCC releases, and the GCC12 changelog says the 
following:

  * *STABS:* Support for emitting the STABS debugging format is
    deprecated and will be removed in the next release. All ports now
    default to emit DWARF (version 2 or later) debugging info or are
    obsoleted.

Since the default is supposed to have changed *in* gcc 12 - which is the 
version that AIX has - or the port be obsolete, it looks to me like that 
gcc on AIX is obsoleted...

In other words, gcc already knows it should change but seems to have 
given up on AIX?

-- 
Cheers,
Guinevere Larsen
She/Her/Hers

[-- Attachment #2: Type: text/html, Size: 3030 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Follow up to stabs deprecation - AIX regressions
  2025-02-13 17:58       ` Guinevere Larsen
@ 2025-02-13 20:21         ` Simon Marchi
  2025-02-14 17:53           ` Guinevere Larsen
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Marchi @ 2025-02-13 20:21 UTC (permalink / raw)
  To: Guinevere Larsen, Kevin Buettner; +Cc: gdb-patches



On 2025-02-13 12:58, Guinevere Larsen wrote:
> On 2/13/25 2:43 PM, Kevin Buettner wrote:
>> On Thu, 13 Feb 2025 14:21:01 -0300
>> Guinevere Larsen <guinevere@redhat.com> wrote:
>>
>>> On 2/13/25 1:48 PM, Kevin Buettner wrote:
>>>> On Thu, 13 Feb 2025 09:25:44 -0300
>>>> Guinevere Larsen <guinevere@redhat.com> wrote:
>>>>  
>>>>> * DWARF reading can sometimes fail in AIX. Currently, reading dwarf for
>>>>> xcoff inferiors is called on it's own, with no warning if dwarf fails
>>>>> (which probably makes sense, considering the default format in aix is
>>>>> still stabs). I added a warning when failing to read dwarf and noticed
>>>>> it being triggered on inferiors compiled with -gdwarf  
>>>> I assume that you mean that stabs is the default when compiling with
>>>> gcc.  Is stabs still also the default format for XLC (IBM Open XL C/C++) ?  
>>> Yes, sorry, I meant gcc. The compile farm had versions 10 and 12, both 
>>> with the same behavior.
>>>
>>> I don't think the compile farm has XLC compilers available for testing, 
>>> or if they do I don't know how to use it, so I couldn't tell you...
>> I think it'd be good to find out XLC's preferred debug format.  If it
>> uses/prefers DWARF, that'd be a good argument for gcc (on AIX)
>> switching to DWARF for it's preferred format too.
>>
>> Kevin
>>
> I just looked over at the GCC releases, and the GCC12 changelog says the following:
> 
>   * *STABS:* Support for emitting the STABS debugging format is deprecated and will be removed in the next release. All ports now default to emit DWARF (version 2 or later) debugging info or are obsoleted.
> 
> Since the default is supposed to have changed *in* gcc 12 - which is the version that AIX has - or the port be obsolete, it looks to me like that gcc on AIX is obsoleted...
> 
> In other words, gcc already knows it should change but seems to have given up on AIX?

Given this commit (present in gcc 11):

https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=56b5d13e27891ed1caec07826a07bb2e0621f914

I would expect gcc 12 to produce DWARF by default, I'm not sure why you
don't see that.

Simon

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Follow up to stabs deprecation - AIX regressions
  2025-02-13 20:21         ` Simon Marchi
@ 2025-02-14 17:53           ` Guinevere Larsen
  0 siblings, 0 replies; 7+ messages in thread
From: Guinevere Larsen @ 2025-02-14 17:53 UTC (permalink / raw)
  To: Simon Marchi, Kevin Buettner; +Cc: gdb-patches

On 2/13/25 5:21 PM, Simon Marchi wrote:
>
> On 2025-02-13 12:58, Guinevere Larsen wrote:
>> On 2/13/25 2:43 PM, Kevin Buettner wrote:
>>> On Thu, 13 Feb 2025 14:21:01 -0300
>>> Guinevere Larsen <guinevere@redhat.com> wrote:
>>>
>>>> On 2/13/25 1:48 PM, Kevin Buettner wrote:
>>>>> On Thu, 13 Feb 2025 09:25:44 -0300
>>>>> Guinevere Larsen <guinevere@redhat.com> wrote:
>>>>>   
>>>>>> * DWARF reading can sometimes fail in AIX. Currently, reading dwarf for
>>>>>> xcoff inferiors is called on it's own, with no warning if dwarf fails
>>>>>> (which probably makes sense, considering the default format in aix is
>>>>>> still stabs). I added a warning when failing to read dwarf and noticed
>>>>>> it being triggered on inferiors compiled with -gdwarf
>>>>> I assume that you mean that stabs is the default when compiling with
>>>>> gcc.  Is stabs still also the default format for XLC (IBM Open XL C/C++) ?
>>>> Yes, sorry, I meant gcc. The compile farm had versions 10 and 12, both
>>>> with the same behavior.
>>>>
>>>> I don't think the compile farm has XLC compilers available for testing,
>>>> or if they do I don't know how to use it, so I couldn't tell you...
>>> I think it'd be good to find out XLC's preferred debug format.  If it
>>> uses/prefers DWARF, that'd be a good argument for gcc (on AIX)
>>> switching to DWARF for it's preferred format too.
>>>
>>> Kevin
>>>
>> I just looked over at the GCC releases, and the GCC12 changelog says the following:
>>
>>    * *STABS:* Support for emitting the STABS debugging format is deprecated and will be removed in the next release. All ports now default to emit DWARF (version 2 or later) debugging info or are obsoleted.
>>
>> Since the default is supposed to have changed *in* gcc 12 - which is the version that AIX has - or the port be obsolete, it looks to me like that gcc on AIX is obsoleted...
>>
>> In other words, gcc already knows it should change but seems to have given up on AIX?
> Given this commit (present in gcc 11):
>
> https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=56b5d13e27891ed1caec07826a07bb2e0621f914
>
> I would expect gcc 12 to produce DWARF by default, I'm not sure why you
> don't see that.
>
> Simon
>
This is kind of weird...

This is a bit of a side diversion, though. The original thing Kevin 
pointed out was whether GDB not reporting that DWARF reading failed was 
related to stabs being the default.

I just double checked, and I don't think it is. elfread reads dwarf in 
an if condition, but doesn't do anything with the result (no matter if 
it is positive or negative). coffread does the same

I think the idea is that maybe the objfile being read may have not been 
compiled with debug symbols in the first place, so warning about it is 
redundant, especially considering that for now, all supported objfiles 
will have at least minsyms available. That will change with removing 
stabs in xcoff, which is why I highlighted that it can fail even with 
existing dwarf in the inferior. It not being reported is the default, 
but is why this has gone unnoticed.

-- 
Cheers,
Guinevere Larsen
She/Her/Hers


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-02-14 17:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-02-13 12:25 Follow up to stabs deprecation - AIX regressions Guinevere Larsen
2025-02-13 16:48 ` Kevin Buettner
2025-02-13 17:21   ` Guinevere Larsen
2025-02-13 17:43     ` Kevin Buettner
2025-02-13 17:58       ` Guinevere Larsen
2025-02-13 20:21         ` Simon Marchi
2025-02-14 17:53           ` Guinevere Larsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox