Stabs debug

Michael Urman mu at tortall.net
Tue Oct 28 13:30:45 PST 2003


On Mon, Oct 27, 2003 at 11:17:41AM +0100, Edouard Gomez wrote:
> When  using stabs as  debug format,  the filename  written to  the debug
> section is relative to the place yam is assembling the file. It would be
> better that yasm took care of turning relative path to absolute paths so
> when debugging,  the debugger will find  the file wherever  we debug the
> application.

I'm not sure what to do here.  We theoretically can make it an option to
generate the absolute path in the N_SO stab, but I don't want to default
to a method other than GCC uses.  And GCC appears to use relative paths:

% gcc -gstabs -o teststabs.o -c modules/objfmts/elf/tests/elftest.c
% objdump -G teststabs.o | grep elftest
0      SO     0      0      00000000 11     modules/objfmts/elf/tests/elftest.c
22     BINCL  0      0      00000000 787    modules/objfmts/elf/tests/elftest.c

Does GCC have an option to make that absolute?  Alternately you can call
yasm with an absolute path to get a stab with an absolute path:

% ./yasm -f elf -g stabs -o teststabs.o \
    % modules/objfmts/elf/tests/elftest.asm
% objdump -G teststabs.o | grep elftest
0      SO     0      0      00000000 1      \
    modules/objfmts/elf/tests/elftest.asm

% ./yasm -f elf -g stabs -o teststabs.o \
    `pwd`/modules/objfmts/elf/tests/elftest.asm
% objdump -G teststabs.o | grep elftest
0      SO     0      0      00000000 1      \
    /home/mu/Projects/yasm/modules/objfmts/elf/tests/elftest.asm



> And there's an annoying message on stdout:

Removed from modules/dbgfmt/stabs/stabs-dbgfmt.c r1.4

-m
-- 
Michael Urman  [- mu at tortall.net -]


More information about the bug-yasm mailing list