This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gas debugging info vs cpp


I recently became aware of the --gdwarf2/--gstabs options to gas, and was
pleased to find that gcc -g turns the appropriate one on automagically when
you use gcc to run the assembler.  For example, 

	$ gcc -c -g foo.S

et voila, I have a foo.o with perfectly lovely DWARF2 information about
the line numbers in a file called /tmp/ccXQLg55.s!  Mighty handy.

So, I would like to fix this.  The question is, what needs to be fixed?
The assembler can learn to grok cpp # lines, or cpp can learn to emit
assembler .file/.line directives.  

The assembler can't just change, since cpp # lines are assembler comments.
So it would need a switch to tell it to grok cpp # lines.  Then gcc would
need to know to pass this switch, meaning it would need to know it had a
new assembler that knew about that switch.

Conversely, cpp under -lang-asm can start emitting .file and .line
directives instead of # lines.  However, the gas manual says that .file and
.line directives are only recognized for compatibility and might go away.
What's the story with that?  For cpp to get such a change, it would be
important to be sure that all past and future assemblers will grok it properly.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]