[Dwarf-discuss] dwarf information for mutiple statements at thesame line.
Michael Eager
eager
Mon Jul 10 15:27:13 GMT 2006
Keith Walker wrote:
>
>
> I have a question about how dwarf deals with multiple statements at
> one line. For example, suppose there is code
>
> f1(); f2();
>
> One sort of related question that I have here is what line/column
> numbers should the compiler generate when multiple statements
> are created by macros.
>
> Suppose that we have a macro:
>
> #define MY_CODE f1(); f2();
>
> and then some code that uses the macro:
>
> MY_CODE
>
> Now I can see that the line number could be that in which the use of
> MY_CODE occurs. However it isn't obvious to me what the column
> information (if any) should be in this case. Any suggestions?
>
> Keith
The source/column information should be for the line which contains
the macro invocation. If the invocation is in column 1, as in your
example, that's the value to use. Many compilers do not generate
any column info.
While macros may expand into additional statements, these are not
present in the source. (They may only be represented as sequences
of tokens and never have even a transient textual existence.)
--
Michael Eager eager at eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
More information about the Dwarf-discuss
mailing list