[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] VMLAB

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] VMLAB
Date: Thu, 24 Apr 2003 23:42:10 +0200 (MET DST)

>I think the situation could be handled by picking up the closest
>non-stabs symbol, and synthesizing a function debugging symbol from
>it.  However, that's a lot of effort.  It's probably more appropriate
>to rather structure the assembler source in a way so it actually emits
>function stabs entries.  This could e. g. be hidden from the user
>inside something like a FUNCTION() macro.

The following assembler file yields the required stabs so i can
successfully convert it to the appropriate COFF debugging symbols that
allow VMLAB to trace it:

 * extern unsigned int getvalue(void);

.stabs  "",100,0,0,getvalue
.stabs  "asm.S",100,0,0,getvalue
.global getvalue
.func   getvalue
        ldi     r24, lo8(0x1234)
        ldi     r25, hi8(0x1234)

The .func/.endfunc pseudo-ops allow the --gstabs option to already
generate an appropriate function symtab entry.  (The function is
declared to return void, and takes no arguments.)  Normally, the stabs
pseudo-ops for the filename should not be needed, however, since this
is preprocessed assembler source, the assembler generates them first
for the temp file that results from the preprocessing step
(/var/tmp/somerandomname.s in my case).  Then, the function stabs and
the respective line numbers are emitted, and only after this, gas
emits an additional stabs for the actual source file name (asm.S in my

By supplying the base filename manually, this can be worked around.
Note that there should only be one pair of type 100 stabs pseudo-ops
per assembler source file, the last field in the pseudo-op describes
the symbol that marks the first .text segment location.  The compiler
usually emits an auxiliary symbol (like Letext1) for this, but it's OK
to use the symbol of the first function in the file.  If there's more
than one function, this must not be repeated again.

Don't know how objtool would translate the above, but chances are good
it worked as well.
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]