Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* AIX DWARF debugging sections
@ 2015-09-25 14:53 David Edelsohn
  2015-09-28 13:41 ` Tristan Gingold
  0 siblings, 1 reply; 17+ messages in thread
From: David Edelsohn @ 2015-09-25 14:53 UTC (permalink / raw)
  To: Tristan Gingold, Joel Brobecker; +Cc: GDB Patches

Initial AIX support for DWARF did not include location lists, debug
frame, and macinfo.  Support was added in a later update.

xcoffread defines most of the sections -- including some that were
included later and omitting some that were included in the initial
implementation.

Does anyone know why pbtyp and mac are not define?  I'm not sure if
AIX .dwamac is macinfo or macro or both.

Thanks, David

* xcoffread (dwrf2_xcoff_names): Add .dwmac and .dwpbtyp.

diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 0d49751..998ca8f 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -159,11 +159,11 @@ static const struct dwarf2_debug_sections dwarf2_xcoff_nam
es = {
   { ".dwabrev", NULL },
   { ".dwline", NULL },
   { ".dwloc", NULL },
-  { NULL, NULL }, /* debug_macinfo */
-  { NULL, NULL }, /* debug_macro */
+  { ".dwmac", NULL },
+  { ".dwmac", NULL },
   { ".dwstr", NULL },
   { ".dwrnges", NULL },
-  { NULL, NULL }, /* debug_types */
+  { ".dwpbtyp", NULL },
   { NULL, NULL }, /* debug_addr */
   { ".dwframe", NULL },
   { NULL, NULL }, /* eh_frame */


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

* Re: AIX DWARF debugging sections
  2015-09-25 14:53 AIX DWARF debugging sections David Edelsohn
@ 2015-09-28 13:41 ` Tristan Gingold
  2015-10-02 21:32   ` Joel Brobecker
  0 siblings, 1 reply; 17+ messages in thread
From: Tristan Gingold @ 2015-09-28 13:41 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Joel Brobecker, GDB Patches


> On 25 Sep 2015, at 16:53, David Edelsohn <dje.gcc@gmail.com> wrote:
> 
> Initial AIX support for DWARF did not include location lists, debug
> frame, and macinfo.  Support was added in a later update.
> 
> xcoffread defines most of the sections -- including some that were
> included later and omitting some that were included in the initial
> implementation.
> 
> Does anyone know why pbtyp and mac are not define?

AFAIK, .debug_pubtypes are not read by gdb.

>  I'm not sure if
> AIX .dwamac is macinfo or macro or both.
> 
> Thanks, David

Your patch looks ok to me, but should be approved by
a global maintainer.

Thanks,
Tristan.


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

* Re: AIX DWARF debugging sections
  2015-09-28 13:41 ` Tristan Gingold
@ 2015-10-02 21:32   ` Joel Brobecker
  2015-10-02 22:35     ` David Edelsohn
  0 siblings, 1 reply; 17+ messages in thread
From: Joel Brobecker @ 2015-10-02 21:32 UTC (permalink / raw)
  To: Tristan Gingold; +Cc: David Edelsohn, GDB Patches

> > On 25 Sep 2015, at 16:53, David Edelsohn <dje.gcc@gmail.com> wrote:
> > 
> > Initial AIX support for DWARF did not include location lists, debug
> > frame, and macinfo.  Support was added in a later update.
> > 
> > xcoffread defines most of the sections -- including some that were
> > included later and omitting some that were included in the initial
> > implementation.
> > 
> > Does anyone know why pbtyp and mac are not define?
> 
> AFAIK, .debug_pubtypes are not read by gdb.
> 
> >  I'm not sure if
> > AIX .dwamac is macinfo or macro or both.
> > 
> > Thanks, David
> 
> Your patch looks ok to me, but should be approved by
> a global maintainer.

It looks odd to me that two entries would have the same name.
Wouldn't it cause GDB to decode the same section both as .debug_macinfo
and .debug_macro?

-- 
Joel


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

* Re: AIX DWARF debugging sections
  2015-10-02 21:32   ` Joel Brobecker
@ 2015-10-02 22:35     ` David Edelsohn
  2015-10-06  0:30       ` Doug Evans
  0 siblings, 1 reply; 17+ messages in thread
From: David Edelsohn @ 2015-10-02 22:35 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Tristan Gingold, GDB Patches

On Fri, Oct 2, 2015 at 5:32 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> > On 25 Sep 2015, at 16:53, David Edelsohn <dje.gcc@gmail.com> wrote:
>> >
>> > Initial AIX support for DWARF did not include location lists, debug
>> > frame, and macinfo.  Support was added in a later update.
>> >
>> > xcoffread defines most of the sections -- including some that were
>> > included later and omitting some that were included in the initial
>> > implementation.
>> >
>> > Does anyone know why pbtyp and mac are not define?
>>
>> AFAIK, .debug_pubtypes are not read by gdb.
>>
>> >  I'm not sure if
>> > AIX .dwamac is macinfo or macro or both.
>> >
>> > Thanks, David
>>
>> Your patch looks ok to me, but should be approved by
>> a global maintainer.
>
> It looks odd to me that two entries would have the same name.
> Wouldn't it cause GDB to decode the same section both as .debug_macinfo
> and .debug_macro?

Because the AIX section does not use the standard name, I am unsure
which it represents.  The documentation only states "dwmac", which
could expand to either name.

Thanks, David


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

* Re: AIX DWARF debugging sections
  2015-10-02 22:35     ` David Edelsohn
@ 2015-10-06  0:30       ` Doug Evans
  2015-10-06 16:52         ` Joel Brobecker
  0 siblings, 1 reply; 17+ messages in thread
From: Doug Evans @ 2015-10-06  0:30 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Joel Brobecker, Tristan Gingold, GDB Patches

On Fri, Oct 2, 2015 at 3:35 PM, David Edelsohn <dje.gcc@gmail.com> wrote:
> On Fri, Oct 2, 2015 at 5:32 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>>> > On 25 Sep 2015, at 16:53, David Edelsohn <dje.gcc@gmail.com> wrote:
>>> >
>>> > Initial AIX support for DWARF did not include location lists, debug
>>> > frame, and macinfo.  Support was added in a later update.
>>> >
>>> > xcoffread defines most of the sections -- including some that were
>>> > included later and omitting some that were included in the initial
>>> > implementation.
>>> >
>>> > Does anyone know why pbtyp and mac are not define?
>>>
>>> AFAIK, .debug_pubtypes are not read by gdb.
>>>
>>> >  I'm not sure if
>>> > AIX .dwamac is macinfo or macro or both.
>>> >
>>> > Thanks, David
>>>
>>> Your patch looks ok to me, but should be approved by
>>> a global maintainer.
>>
>> It looks odd to me that two entries would have the same name.
>> Wouldn't it cause GDB to decode the same section both as .debug_macinfo
>> and .debug_macro?
>
> Because the AIX section does not use the standard name, I am unsure
> which it represents.  The documentation only states "dwmac", which
> could expand to either name.
>
> Thanks, David

Yeah, I think we need to figure out which one it is.


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

* Re: AIX DWARF debugging sections
  2015-10-06  0:30       ` Doug Evans
@ 2015-10-06 16:52         ` Joel Brobecker
  2015-10-06 16:55           ` David Edelsohn
  2015-10-06 18:24           ` David Edelsohn
  0 siblings, 2 replies; 17+ messages in thread
From: Joel Brobecker @ 2015-10-06 16:52 UTC (permalink / raw)
  To: Doug Evans; +Cc: David Edelsohn, Tristan Gingold, GDB Patches

> > Because the AIX section does not use the standard name, I am unsure
> > which it represents.  The documentation only states "dwmac", which
> > could expand to either name.
> >
> > Thanks, David
> 
> Yeah, I think we need to figure out which one it is.

That's what I have been trying to do, but I don't see any evidence
that GCC emits it, or that binutils handles it. So the answer must
lie somewhere on the system side. David?

-- 
Joel


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

* Re: AIX DWARF debugging sections
  2015-10-06 16:52         ` Joel Brobecker
@ 2015-10-06 16:55           ` David Edelsohn
  2015-10-06 18:24           ` David Edelsohn
  1 sibling, 0 replies; 17+ messages in thread
From: David Edelsohn @ 2015-10-06 16:55 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Doug Evans, Tristan Gingold, GDB Patches

On Tue, Oct 6, 2015 at 12:51 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> > Because the AIX section does not use the standard name, I am unsure
>> > which it represents.  The documentation only states "dwmac", which
>> > could expand to either name.
>> >
>> > Thanks, David
>>
>> Yeah, I think we need to figure out which one it is.
>
> That's what I have been trying to do, but I don't see any evidence
> that GCC emits it, or that binutils handles it. So the answer must
> lie somewhere on the system side. David?

GCC emits it when -g3 is enabled.  Ldebug_macinfo vs Ldebug_macro is
controlled by dwarf_strict.  The current GCC support for DWARF in AIX
uses the same section name for both.

I am asking the XLC team what they produce for the section.

Thanks, David


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

* Re: AIX DWARF debugging sections
  2015-10-06 16:52         ` Joel Brobecker
  2015-10-06 16:55           ` David Edelsohn
@ 2015-10-06 18:24           ` David Edelsohn
  2015-10-06 20:00             ` Doug Evans
  1 sibling, 1 reply; 17+ messages in thread
From: David Edelsohn @ 2015-10-06 18:24 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Doug Evans, Tristan Gingold, GDB Patches

On Tue, Oct 6, 2015 at 12:51 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> > Because the AIX section does not use the standard name, I am unsure
>> > which it represents.  The documentation only states "dwmac", which
>> > could expand to either name.
>> >
>> > Thanks, David
>>
>> Yeah, I think we need to figure out which one it is.
>
> That's what I have been trying to do, but I don't see any evidence
> that GCC emits it, or that binutils handles it. So the answer must
> lie somewhere on the system side. David?

The official answer from IBM XLC is the section is for both
.debug_macinfo and .debug_macro

For DWARF4 and below, the dwmac section corresponds to .debug_macinfo.
For DWARF5 and above, the dwmac section corresponds to .debug_macro.

XLC currently does not generate any macro debugging information for DWARF4.

- David


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

* Re: AIX DWARF debugging sections
  2015-10-06 18:24           ` David Edelsohn
@ 2015-10-06 20:00             ` Doug Evans
  2015-10-07 12:49               ` David Edelsohn
  0 siblings, 1 reply; 17+ messages in thread
From: Doug Evans @ 2015-10-06 20:00 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Joel Brobecker, Tristan Gingold, GDB Patches

On Tue, Oct 6, 2015 at 11:24 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
> On Tue, Oct 6, 2015 at 12:51 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>>> > Because the AIX section does not use the standard name, I am unsure
>>> > which it represents.  The documentation only states "dwmac", which
>>> > could expand to either name.
>>> >
>>> > Thanks, David
>>>
>>> Yeah, I think we need to figure out which one it is.
>>
>> That's what I have been trying to do, but I don't see any evidence
>> that GCC emits it, or that binutils handles it. So the answer must
>> lie somewhere on the system side. David?
>
> The official answer from IBM XLC is the section is for both
> .debug_macinfo and .debug_macro
>
> For DWARF4 and below, the dwmac section corresponds to .debug_macinfo.
> For DWARF5 and above, the dwmac section corresponds to .debug_macro.
>
> XLC currently does not generate any macro debugging information for DWARF4.

Huh.
Let's make sure this is documented in the code.


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

* Re: AIX DWARF debugging sections
  2015-10-06 20:00             ` Doug Evans
@ 2015-10-07 12:49               ` David Edelsohn
  2015-10-10  0:04                 ` Joel Brobecker
  0 siblings, 1 reply; 17+ messages in thread
From: David Edelsohn @ 2015-10-07 12:49 UTC (permalink / raw)
  To: Doug Evans; +Cc: Joel Brobecker, Tristan Gingold, GDB Patches

On Tue, Oct 6, 2015 at 3:59 PM, Doug Evans <dje@google.com> wrote:
> On Tue, Oct 6, 2015 at 11:24 AM, David Edelsohn <dje.gcc@gmail.com> wrote:
>> On Tue, Oct 6, 2015 at 12:51 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>>>> > Because the AIX section does not use the standard name, I am unsure
>>>> > which it represents.  The documentation only states "dwmac", which
>>>> > could expand to either name.
>>>> >
>>>> > Thanks, David
>>>>
>>>> Yeah, I think we need to figure out which one it is.
>>>
>>> That's what I have been trying to do, but I don't see any evidence
>>> that GCC emits it, or that binutils handles it. So the answer must
>>> lie somewhere on the system side. David?
>>
>> The official answer from IBM XLC is the section is for both
>> .debug_macinfo and .debug_macro
>>
>> For DWARF4 and below, the dwmac section corresponds to .debug_macinfo.
>> For DWARF5 and above, the dwmac section corresponds to .debug_macro.
>>
>> XLC currently does not generate any macro debugging information for DWARF4.
>
> Huh.
> Let's make sure this is documented in the code.

Is the following sufficient or you would like more exposition?

diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 0d49751..86d4ca4 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -159,11 +159,11 @@ static const struct dwarf2_debug_sections
dwarf2_xcoff_names = {
   { ".dwabrev", NULL },
   { ".dwline", NULL },
   { ".dwloc", NULL },
-  { NULL, NULL }, /* debug_macinfo */
-  { NULL, NULL }, /* debug_macro */
+  { ".dwmac", NULL }, /* debug_macinfo for DWARF4 and below */
+  { ".dwmac", NULL }, /* debug_macro for DWARF5 and above */
   { ".dwstr", NULL },
   { ".dwrnges", NULL },
-  { NULL, NULL }, /* debug_types */
+  { ".dwpbtyp", NULL },
   { NULL, NULL }, /* debug_addr */
   { ".dwframe", NULL },
   { NULL, NULL }, /* eh_frame */

Thanks, David


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

* Re: AIX DWARF debugging sections
  2015-10-07 12:49               ` David Edelsohn
@ 2015-10-10  0:04                 ` Joel Brobecker
       [not found]                   ` <CADPb22QmuPeP_QBDNWA4iSi1jsnTvAiAurV8HWGCAYnPoMr+wg@mail.gmail.com>
  0 siblings, 1 reply; 17+ messages in thread
From: Joel Brobecker @ 2015-10-10  0:04 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Doug Evans, Tristan Gingold, GDB Patches

> >>> That's what I have been trying to do, but I don't see any evidence
> >>> that GCC emits it, or that binutils handles it. So the answer must
> >>> lie somewhere on the system side. David?
> >>
> >> The official answer from IBM XLC is the section is for both
> >> .debug_macinfo and .debug_macro
> >>
> >> For DWARF4 and below, the dwmac section corresponds to .debug_macinfo.
> >> For DWARF5 and above, the dwmac section corresponds to .debug_macro.
> >>
> >> XLC currently does not generate any macro debugging information for DWARF4.
> >
> > Huh.
> > Let's make sure this is documented in the code.
> 
> Is the following sufficient or you would like more exposition?
> 
> diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
> index 0d49751..86d4ca4 100644
> --- a/gdb/xcoffread.c
> +++ b/gdb/xcoffread.c
> @@ -159,11 +159,11 @@ static const struct dwarf2_debug_sections
> dwarf2_xcoff_names = {
>    { ".dwabrev", NULL },
>    { ".dwline", NULL },
>    { ".dwloc", NULL },
> -  { NULL, NULL }, /* debug_macinfo */
> -  { NULL, NULL }, /* debug_macro */
> +  { ".dwmac", NULL }, /* debug_macinfo for DWARF4 and below */
> +  { ".dwmac", NULL }, /* debug_macro for DWARF5 and above */

Looking at the code in GDB reading the DWARF sections, I am a little
uncomfortable having two entries for 2 sections sharing the same name.
I don't have a full grasp of that code, so maybe things would be fine,
but I'm not sure. Doug has more experience with this code, so might
know better.

In the meantime, I started exploring a bit on the GCC side. I have
been using GCC 4.9, which I think is an interesting reference,
because not super recent. What I have found is that, unless you
use -gstrict-dwarf, GCC generates a .debug_macro section. You have
to use -gstrict-dwarf to get the older .debug_macinfo format.

The bad new is: once assembled using GNU as, the section name
in the object file is .dwmacro, not .dwmac. As for the .debug_macinfo
section, it gets renamed to .dwmacif.

I'm not really sure how to best proceed, here. On the one hand,
IBM can be considered the authority on these kinds of questions.
On the other hand, GDB being a GNU tool, we should probably make
it easier to debug code produced by GNU tools rather than by
propriatery ones... It's particularly tempting since GNU as
has chosen different section names, which seems to be a better
choice to me, and also happens to make it easier on the code.

Perhaps what we could do is handle it at the binutils level,
and pretend that ".dwmac" is actually ".dwmacro" or ".dwmacif"
depending on the compilation unit's DWARF version. Then GDB
would be modified to handle the names chosen on the GNU side.

>    { ".dwstr", NULL },
>    { ".dwrnges", NULL },
> -  { NULL, NULL }, /* debug_types */
> +  { ".dwpbtyp", NULL },
>    { NULL, NULL }, /* debug_addr */
>    { ".dwframe", NULL },
>    { NULL, NULL }, /* eh_frame */
> 
> Thanks, David

-- 
Joel


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

* Re: AIX DWARF debugging sections
       [not found]                   ` <CADPb22QmuPeP_QBDNWA4iSi1jsnTvAiAurV8HWGCAYnPoMr+wg@mail.gmail.com>
@ 2015-10-10  2:58                     ` David Edelsohn
  2015-10-12 15:50                       ` Joel Brobecker
  0 siblings, 1 reply; 17+ messages in thread
From: David Edelsohn @ 2015-10-10  2:58 UTC (permalink / raw)
  To: Doug Evans, Joel Brobecker, Tristan Gingold; +Cc: GDB Patches

On Fri, Oct 9, 2015 at 8:24 PM, Doug Evans <dje@google.com> wrote:
> On Fri, Oct 9, 2015 at 5:04 PM, Joel Brobecker <brobecker@adacore.com>
> wrote:
>>
>> > >>> That's what I have been trying to do, but I don't see any evidence
>> > >>> that GCC emits it, or that binutils handles it. So the answer must
>> > >>> lie somewhere on the system side. David?
>> > >>
>> > >> The official answer from IBM XLC is the section is for both
>> > >> .debug_macinfo and .debug_macro
>> > >>
>> > >> For DWARF4 and below, the dwmac section corresponds to
>> > >> .debug_macinfo.
>> > >> For DWARF5 and above, the dwmac section corresponds to .debug_macro.
>> > >>
>> > >> XLC currently does not generate any macro debugging information for
>> > >> DWARF4.
>> > >
>> > > Huh.
>> > > Let's make sure this is documented in the code.
>> >
>> > Is the following sufficient or you would like more exposition?
>> >
>> > diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
>> > index 0d49751..86d4ca4 100644
>> > --- a/gdb/xcoffread.c
>> > +++ b/gdb/xcoffread.c
>> > @@ -159,11 +159,11 @@ static const struct dwarf2_debug_sections
>> > dwarf2_xcoff_names = {
>> >    { ".dwabrev", NULL },
>> >    { ".dwline", NULL },
>> >    { ".dwloc", NULL },
>> > -  { NULL, NULL }, /* debug_macinfo */
>> > -  { NULL, NULL }, /* debug_macro */
>> > +  { ".dwmac", NULL }, /* debug_macinfo for DWARF4 and below */
>> > +  { ".dwmac", NULL }, /* debug_macro for DWARF5 and above */
>>
>> Looking at the code in GDB reading the DWARF sections, I am a little
>> uncomfortable having two entries for 2 sections sharing the same name.
>> I don't have a full grasp of that code, so maybe things would be fine,
>> but I'm not sure. Doug has more experience with this code, so might
>> know better.
>
>
>
> Yeah, I'm worried that the two are incompatible,
> and thus using the same name for both will be problematic,
> but I haven't found time to verify.
>
>
>>
>>
>> In the meantime, I started exploring a bit on the GCC side. I have
>> been using GCC 4.9, which I think is an interesting reference,
>> because not super recent. What I have found is that, unless you
>> use -gstrict-dwarf, GCC generates a .debug_macro section. You have
>> to use -gstrict-dwarf to get the older .debug_macinfo format.
>>
>> The bad new is: once assembled using GNU as, the section name
>> in the object file is .dwmacro, not .dwmac. As for the .debug_macinfo
>> section, it gets renamed to .dwmacif.

Those are the GNU as section names invented by Adacore, not the AIX as
section names and not used by any tools outside of Adacore.  This
explanation refers to private patches from Adacore and not the current
support in GCC.

>>
>> I'm not really sure how to best proceed, here. On the one hand,
>> IBM can be considered the authority on these kinds of questions.
>> On the other hand, GDB being a GNU tool, we should probably make
>> it easier to debug code produced by GNU tools rather than by
>> propriatery ones... It's particularly tempting since GNU as
>> has chosen different section names, which seems to be a better
>> choice to me, and also happens to make it easier on the code.
>
>
> Agreed.

Not agreed.

AIX has a definition of DWARF on the platform.  Adacore invented an
incompatible definition of DWARF on AIX (and has known about the
correct definition since 2011).  How can GDB developers argue for
conformance with various standards, but ignore the definitions and
documentation of AIX?

GNU as and ld are not used outside of Adacore.  Everyone discussing
what to do for the platform and what is possible on the platform
apparently is unaware of the general use of the GNU Toolchain on the
platform.

The last I heard, Adacore had private patches for GNU as and GNU that
they had not contributed and the patches were just enough for the
needs of Adacore, not a general substitute for AIX as and AIX ld.

Since my initial conversations with Adacore in 2011, Olivier and
Tristan assured me that they would support the AIX .dwsect DWARF
sections in the tools.  Now Adacore seems to be disregarding that
agreement.

DWARF on AIX isn't a private protocol between GCC and GDB.  XLC
produces executables and libraries following the AIX DWARF standard
and section naming.  GDB must follow the AIX DWARF standard to be able
to interpret debugging information produced by XLC.

>
>>
>>
>> Perhaps what we could do is handle it at the binutils level,
>> and pretend that ".dwmac" is actually ".dwmacro" or ".dwmacif"
>> depending on the compilation unit's DWARF version. Then GDB
>> would be modified to handle the names chosen on the GNU side.
>
>
>
> Possible alright.
> It feels a bit subtle,
> Can we wait to here from IBM before going with this?

If everyone wants GDB to have an additional Adacore mode, that's fine,
but that's not DWARF on AIX.  .dwmacro and .dwmacif can be GNU
extensions used by Adacore, but they are not appropriate as a general
solution.

GNU as and ld are not used to build applications on AIX, other than
Adacore.  Any solution predicated on binutils is not a general
solution.

AIX XLC apparently will not utilize .dwmac macro section until DWARF5
to encore the .debug_macro section, so GCC and GDB should utilize it
as .debug_macro and not produce or consume .debug_macinfo.

Thanks, David


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

* Re: AIX DWARF debugging sections
  2015-10-10  2:58                     ` David Edelsohn
@ 2015-10-12 15:50                       ` Joel Brobecker
  2015-10-12 17:41                         ` David Edelsohn
  0 siblings, 1 reply; 17+ messages in thread
From: Joel Brobecker @ 2015-10-12 15:50 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Doug Evans, Tristan Gingold, GDB Patches

> >> I'm not really sure how to best proceed, here. On the one hand,
> >> IBM can be considered the authority on these kinds of questions.
> >> On the other hand, GDB being a GNU tool, we should probably make
> >> it easier to debug code produced by GNU tools rather than by
> >> propriatery ones... It's particularly tempting since GNU as
> >> has chosen different section names, which seems to be a better
> >> choice to me, and also happens to make it easier on the code.
> >
> >
> > Agreed.
> 
> Not agreed.
> 
> AIX has a definition of DWARF on the platform.  Adacore invented an
> incompatible definition of DWARF on AIX (and has known about the
> correct definition since 2011).  How can GDB developers argue for
> conformance with various standards, but ignore the definitions and
> documentation of AIX?

Unfortunately, David is right. I personally hadn't known about AIX's
definition of DWARF, but it doesn't matter. I thought we had contributed
our patches by now, but it appears it's been stalled due to some
technical issues that Tristan didn't want to spend time on, and that
therefore, submission has only been partial.

So IBM's definition should be considered as reference, and AdaCore
will have to deal with whatever happens because of it.

> AIX XLC apparently will not utilize .dwmac macro section until DWARF5
> to encore the .debug_macro section, so GCC and GDB should utilize it
> as .debug_macro and not produce or consume .debug_macinfo.

OK, if macinfo data cannot be generated by XLC, then it would make
sense to me to just ammend your patch to only update the .debug_macro
entry. If that's correct, then that avoids the concern I had about
having two entries with the same section name.

-- 
Joel


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

* Re: AIX DWARF debugging sections
  2015-10-12 15:50                       ` Joel Brobecker
@ 2015-10-12 17:41                         ` David Edelsohn
  2015-10-12 18:34                           ` Joel Brobecker
  0 siblings, 1 reply; 17+ messages in thread
From: David Edelsohn @ 2015-10-12 17:41 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Doug Evans, Tristan Gingold, GDB Patches

On Mon, Oct 12, 2015 at 11:50 AM, Joel Brobecker <brobecker@adacore.com> wrote:

>> AIX XLC apparently will not utilize .dwmac macro section until DWARF5
>> to encore the .debug_macro section, so GCC and GDB should utilize it
>> as .debug_macro and not produce or consume .debug_macinfo.
>
> OK, if macinfo data cannot be generated by XLC, then it would make
> sense to me to just ammend your patch to only update the .debug_macro
> entry. If that's correct, then that avoids the concern I had about
> having two entries with the same section name.

Appended is a revised patch that associates .dwmac with debug_macro.
I will revise GCC accordingly.

Thanks, David

* xcoffread (dwrf2_xcoff_names): Add .dwmac and .dwpbtyp.

diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 0d49751..5f27859 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -159,11 +159,11 @@ static const struct dwarf2_debug_sections dwarf2_xcoff_nam
es = {
   { ".dwabrev", NULL },
   { ".dwline", NULL },
   { ".dwloc", NULL },
-  { NULL, NULL }, /* debug_macinfo */
-  { NULL, NULL }, /* debug_macro */
+  { NULL, NULL }, /* XLC does not generate debug_macinfo for DWARF4 and below *
/
+  { ".dwmac", NULL }, /* debug_macro for DWARF5 and above */
   { ".dwstr", NULL },
   { ".dwrnges", NULL },
-  { NULL, NULL }, /* debug_types */
+  { ".dwpbtyp", NULL },
   { NULL, NULL }, /* debug_addr */
   { ".dwframe", NULL },
   { NULL, NULL }, /* eh_frame */


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

* Re: AIX DWARF debugging sections
  2015-10-12 17:41                         ` David Edelsohn
@ 2015-10-12 18:34                           ` Joel Brobecker
  2015-10-13 15:33                             ` David Edelsohn
  0 siblings, 1 reply; 17+ messages in thread
From: Joel Brobecker @ 2015-10-12 18:34 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Doug Evans, Tristan Gingold, GDB Patches

> Thanks, David
> 
> * xcoffread (dwrf2_xcoff_names): Add .dwmac and .dwpbtyp.

Looks good to me with just one nit.

> 
> diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
> index 0d49751..5f27859 100644
> --- a/gdb/xcoffread.c
> +++ b/gdb/xcoffread.c
> @@ -159,11 +159,11 @@ static const struct dwarf2_debug_sections dwarf2_xcoff_nam
> es = {
>    { ".dwabrev", NULL },
>    { ".dwline", NULL },
>    { ".dwloc", NULL },
> -  { NULL, NULL }, /* debug_macinfo */
> -  { NULL, NULL }, /* debug_macro */
>    { NULL, NULL }, /* XLC does not generate debug_macinfo for DWARF4 and below *
> /

the GNU Coding Standards ask us that sentences end with a period. So
unfortunately, we're going to have to split that line in two.

  { NULL, NULL }, /* XLC does not generate debug_macinfo for DWARF4
                     and below.  */

> +  { ".dwmac", NULL }, /* debug_macro for DWARF5 and above */
>    { ".dwstr", NULL },
>    { ".dwrnges", NULL },
> -  { NULL, NULL }, /* debug_types */
> +  { ".dwpbtyp", NULL },
>    { NULL, NULL }, /* debug_addr */
>    { ".dwframe", NULL },
>    { NULL, NULL }, /* eh_frame */

-- 
Joel


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

* Re: AIX DWARF debugging sections
  2015-10-12 18:34                           ` Joel Brobecker
@ 2015-10-13 15:33                             ` David Edelsohn
  2015-10-13 16:45                               ` Joel Brobecker
  0 siblings, 1 reply; 17+ messages in thread
From: David Edelsohn @ 2015-10-13 15:33 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: Doug Evans, Tristan Gingold, GDB Patches

On Mon, Oct 12, 2015 at 2:34 PM, Joel Brobecker <brobecker@adacore.com> wrote:
>> Thanks, David
>>
>> * xcoffread (dwrf2_xcoff_names): Add .dwmac and .dwpbtyp.
>
> Looks good to me with just one nit.
> the GNU Coding Standards ask us that sentences end with a period. So
> unfortunately, we're going to have to split that line in two.

For full sentences, we might as well document it more completely.

Thanks, David

diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
index 0d49751..e4af37c 100644
--- a/gdb/xcoffread.c
+++ b/gdb/xcoffread.c
@@ -159,11 +159,14 @@ static const struct dwarf2_debug_sections dwarf2_xcoff_nam
es = {
   { ".dwabrev", NULL },
   { ".dwline", NULL },
   { ".dwloc", NULL },
-  { NULL, NULL }, /* debug_macinfo */
-  { NULL, NULL }, /* debug_macro */
+  /* AIX XCOFF defines one, named DWARF section for macro debug information.
+     XLC does not generate debug_macinfo for DWARF4 and below.
+     The section is assigned to debug_macro for DWARF5 and above. */
+  { NULL, NULL },
+  { ".dwmac", NULL },
   { ".dwstr", NULL },
   { ".dwrnges", NULL },
-  { NULL, NULL }, /* debug_types */
+  { ".dwpbtyp", NULL },
   { NULL, NULL }, /* debug_addr */
   { ".dwframe", NULL },
   { NULL, NULL }, /* eh_frame */


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

* Re: AIX DWARF debugging sections
  2015-10-13 15:33                             ` David Edelsohn
@ 2015-10-13 16:45                               ` Joel Brobecker
  0 siblings, 0 replies; 17+ messages in thread
From: Joel Brobecker @ 2015-10-13 16:45 UTC (permalink / raw)
  To: David Edelsohn; +Cc: Doug Evans, Tristan Gingold, GDB Patches

> For full sentences, we might as well document it more completely.

Good idea. The patch looks good to me.

> diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c
> index 0d49751..e4af37c 100644
> --- a/gdb/xcoffread.c
> +++ b/gdb/xcoffread.c
> @@ -159,11 +159,14 @@ static const struct dwarf2_debug_sections dwarf2_xcoff_nam
> es = {
>    { ".dwabrev", NULL },
>    { ".dwline", NULL },
>    { ".dwloc", NULL },
> -  { NULL, NULL }, /* debug_macinfo */
> -  { NULL, NULL }, /* debug_macro */
> +  /* AIX XCOFF defines one, named DWARF section for macro debug information.
> +     XLC does not generate debug_macinfo for DWARF4 and below.
> +     The section is assigned to debug_macro for DWARF5 and above. */
> +  { NULL, NULL },
> +  { ".dwmac", NULL },
>    { ".dwstr", NULL },
>    { ".dwrnges", NULL },
> -  { NULL, NULL }, /* debug_types */
> +  { ".dwpbtyp", NULL },
>    { NULL, NULL }, /* debug_addr */
>    { ".dwframe", NULL },
>    { NULL, NULL }, /* eh_frame */

-- 
Joel


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

end of thread, other threads:[~2015-10-13 16:45 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-25 14:53 AIX DWARF debugging sections David Edelsohn
2015-09-28 13:41 ` Tristan Gingold
2015-10-02 21:32   ` Joel Brobecker
2015-10-02 22:35     ` David Edelsohn
2015-10-06  0:30       ` Doug Evans
2015-10-06 16:52         ` Joel Brobecker
2015-10-06 16:55           ` David Edelsohn
2015-10-06 18:24           ` David Edelsohn
2015-10-06 20:00             ` Doug Evans
2015-10-07 12:49               ` David Edelsohn
2015-10-10  0:04                 ` Joel Brobecker
     [not found]                   ` <CADPb22QmuPeP_QBDNWA4iSi1jsnTvAiAurV8HWGCAYnPoMr+wg@mail.gmail.com>
2015-10-10  2:58                     ` David Edelsohn
2015-10-12 15:50                       ` Joel Brobecker
2015-10-12 17:41                         ` David Edelsohn
2015-10-12 18:34                           ` Joel Brobecker
2015-10-13 15:33                             ` David Edelsohn
2015-10-13 16:45                               ` Joel Brobecker

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