Home:ALL Converter>DWARF DI with generated C code?

DWARF DI with generated C code?

Ask Time:2016-10-08T09:01:37         Author:Jon Flow

Json Formatter

I can't seem to find any good documentation for the DWARF DI format to answer my question. I'm writing a language that compiles to C, is there any way that I can produce DWARF Debug Information into the C code or is it assembly only?

Is it impossible to add debug information to some (generated) C code other than using primitive stuff that isn't as good like #line and the #file directives?

Author:Jon Flow,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/39927646/dwarf-di-with-generated-c-code
Tom Tromey :

It can be done for some things, if you assume your compiler can emit assembly. For an example of this, see my favorite gdb test case.\n\nNormally this isn't done, though. It can be quite hard to get right. Nowadays it's better to either write your compiler to be a direct front-end to GCC or LLVM; or to write gdb or lldb helper scripts to make debugging the generated C code simpler.",
2016-10-08T02:15:21
yy