This is the mail archive of the
mailing list for the binutils project.
Re: dwarf debug information support for ELF targets in the assembler
On Mar 22, 2012, at 11:22 AM, Ramana wrote:
> Hi Tristian,
> For the following assembly, I do not get any debug info generated even
> after providing -g flag.
> .global g_var
> .type g_var, @object
> .local l_var
> .type l_var, @object
> .section .data
> .word 10
> .size g_var, .-g_var
> .word 20
> .size l_var, .-l_var
Correct, because there is no code. GAS can emit line info for each instructions, which
is very useful while stepping in code.
For data, the symbol table contains all available information (symbol name, address and size).
> On Thu, Mar 22, 2012 at 3:47 PM, Tristan Gingold <email@example.com> wrote:
>> On Mar 22, 2012, at 11:12 AM, Ramana wrote:
>>> For an ELF target, while debugging the hand written assembly code, I
>>> couldn't see the file local & global symbols defined in the assembly
>>> files in the debugger symbols list. But then I realized that there is
>>> no debug information in the final executable file for those symbols.
>>> Is it possible to specify (define) and/or generate dwarf debug
>>> information for the hand written assembly code from the assembler?
>> Yes, assemble with -g.
>>> Are there any existing mechanisms (assembler directives etc) to enable
>>> this support for ELF targets? If yes, any reference port available in
>>> the binutils mainline?
>>> How difficult would it be if the support has to be enabled from the scratch?