Hi,
I'm trying to use the new debug info and I seem to have broken something. The attached LLVM assembly is the result of compiling a simple main() function. If I generate x86 assembly language from this I get the attached assembly file.
The debug info seems complete, except that the .Lfunc_begin symbol is referenced but not defined in the .s file.
llvm-dis, llvm-as, and llc seem perfectly happy with this, but the assembler complains about the undefined symbol. Any clues?
-Rich
main.o.ll (2.44 KB)
main.o.s (10.6 KB)
Hi Richard,
How do you produce this LLVM assembly? In newest form,
llvm.dbg.func_start intrinsic is not used.
Devang Patel wrote:
Hi Richard,
How do you produce this LLVM assembly? In newest form,
llvm.dbg.func_start intrinsic is not used.
-
Devang
Hi Devang,
The assembly is disassembled from bitcode that I create.
I must be using obsolete remnants of the API. I'm calling EmitFunctionStart(), EmitStopPoint(), etc. What should I be using?
-Rich
Richard Pennington wrote:
Devang Patel wrote:
Hi Richard,
How do you produce this LLVM assembly? In newest form,
llvm.dbg.func_start intrinsic is not used.
-
Devang
Hi Devang,
The assembly is disassembled from bitcode that I create.
I must be using obsolete remnants of the API. I'm calling EmitFunctionStart(), EmitStopPoint(), etc. What should I be using?
-Rich
I realize my question makes no sense. I was using code borrowed from clang. I'll check out what clang is doing now.
-Rich
Hi Richard,
Devang Patel wrote:
Hi Richard,
How do you produce this LLVM assembly? In newest form,
llvm.dbg.func_start intrinsic is not used.
-
Devang
Hi Devang,
The assembly is disassembled from bitcode that I create.
I must be using obsolete remnants of the API. I'm calling
EmitFunctionStart(), EmitStopPoint(), etc. What should I be using?
Instead of calling EmitFunctionStart(), you keep track of lexical
scopes in a stack. And instead of calling EmitStopPoint(), you update
current location info and attach updated location info with subsequent
instructions.
See CGDebugInfo::EmitStopPoint() and CGDebugInfo::EmitFunctionStart()
in CGDebugInfo.cpp from clang.
http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDebugInfo.cpp?view=markup
Here,
- ATTACH_DEBUG_INFO_TO_AN_INSN is now defined.
- IRBuilder is used to build IR. IRBuilder now provides APIs to keep
track of current location info to encode debugging information. So
whenever new instruction is created, the IRBuilder automatically
attach current location info with the new instruction.
Eventually, I'll document this and remove support for
llvm.dbg.stoppoint and related intrinsics' support.