[LLVMdev] dwarf directory table and file table
Rafael Ávila de Espíndola
rafael.espindola at gmail.com
Tue Aug 2 19:16:17 PDT 2011
On 2011-08-02 21:56, Nick Lewycky wrote:
> I've been looking into the debug info in llvm recently. After conferring
> with a DWARF expert, I think what we really want for a file is to enter
> the actual name of the header that the preprocessor found between "" or
> <> on the #include line, and for the directory it should be the actual
> header search path used.
>
> I started by taking a look at how LLVM encodes this in a .s file and got
> pretty confused pretty quickly. For starters, we don't seem to ever emit
> any data directly into the .debug_line section directly. Is it filled in
> by the assembler based on the .file and .line directives? It seems like
> the assembler doesn't actually offer independent control of the
> directory and the file names? I guess I could invent new assembly
> directives, but it seems pretty surprising that I would need to! Have I
> gotten myself on the wrong track?
I have no idea what is the "correct" behavior for DWARF, but with gcc
4.5 I get:
.file 1 "llvm/bar.h"
...
.file 2 "test.c"
When bar.h was found with -I and the include was '#include "bar.h"'. How
does gdb/llvm use this information?
> Nick
Cheers,
Rafael
More information about the llvm-dev
mailing list