This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: stabs.texinfo update for macro define/undefine
- From: Jim Blandy <jimb at codesourcery dot com>
- To: David Taylor <dtaylor at emc dot com>
- Cc: gdb-patches at sourceware dot org, Eli Zaretskii <eliz at gnu dot org>
- Date: Wed, 01 Nov 2006 11:32:15 -0800
- Subject: Re: stabs.texinfo update for macro define/undefine
- References: <200610251931.k9PJVRDO011265@mailhub.lss.emc.com> <ud58guoa6.fsf@gnu.org> <200610302225.k9UMPLZ9001050@mailhub.lss.emc.com> <m3odrsoyry.fsf@codesourcery.com> <200611010305.kA135iYx019864@mailhub.lss.emc.com>
David Taylor <dtaylor@emc.com> writes:
>> From: Jim Blandy <jimb@codesourcery.com>
>> Date: Tue, 31 Oct 2006 15:23:29 -0800
>>
>> It's clear from the example, but it would be nice if the text
>> explicitly explained how function-like macro arguments appear in the
>> N_MAC_DEFINE stabs. It also should explain how the following are
>> distinguished:
>>
>> #define foo x
>> #define foo() x
>>
>> With the latter #definition, 'foo' followed by something other than an
>> opening parenthesis isn't replaced.
>
> The former shows up as "foo x", the latter as "foo() x".
>
> Yes, the example could be enhanced to illustrate that. And a little
> more about the ``transformation'' from what is found in the *.c file
> to the stabs entry.
>
> But, as to the latter -- am I misunderstanding you? Are you asking
> for text about when something is replaced versus when it isn't
> replaced? If yes, that is *WAY* beyond the scope of the file. The
> file deals exclusively with *STABS*. When something is replaced vs
> not replaced is a CPP issue. It has nothing to do with STABS.
No, of course not --- we both agree that your text only needs to
describe how to convey all the possible sorts of preprocessor macro
definitions accurately from the compiler to the debugger in STABS. I
just had two points:
- I think the text ought to actually state all the rules needed to do
the job correctly, and not leave details to examples.
- There are some cases your examples didn't cover. (Of course, what's
a separate case and what's just a specialization of a more general
thing is sort of a matter of taste. But it was something I remember
running into when I did the existing DWARF macro code, so I thought
I'd mention it.)