Quuxplusone / LLVMBugzillaTest

0 stars 0 forks source link

debug info for MACRO not produced #14180

Open Quuxplusone opened 11 years ago

Quuxplusone commented 11 years ago
Bugzilla Link PR14152
Status NEW
Importance P enhancement
Reported by Olga (olga.a.chupina@gmail.com)
Reported on 2012-10-23 06:32:34 -0700
Last modified on 2018-10-25 20:12:10 -0700
Version trunk
Hardware Macintosh MacOS X
CC amjad.aboud@intel.com, aprantl@apple.com, echristo@gmail.com, geek4civic@gmail.com, llvm-bugs@lists.llvm.org, pawel@32bitmicro.com, richard-llvm@metafoo.co.uk
Fixed by commit(s)
Attachments test2.bc (3027 bytes, text/plain)
Blocks PR24345
Blocked by
See also
Created attachment 9404
bitcode file

Consider the test:

$ cat test2.c
#define ADD1(x) (x+1)
int n = 0;
int main(int argc) {
    int n = ADD1(argc);
    return n;
}

Macro ADD1 is not mentioned in debug info for test2.c. Are there any plans on
adding debug info for macros in clang?

Compilation line: clang -g -O0 test2.c -emit-llvm -o test2.bc -S

Olga Chupina
---
Software Engineer
Intel Compiler Team
Intel Corp.
Quuxplusone commented 11 years ago

Attached test2.bc (3027 bytes, text/plain): bitcode file

Quuxplusone commented 11 years ago

I don't know of anyone planning to do this, but it is generally only produced when using "-g3" since it bloats generated debug information significantly.

Quuxplusone commented 11 years ago

I'm not planning (and don't know of anyone planning) to do this anytime soon, no.

Quuxplusone commented 7 years ago
Debug info macros is already support in dwarf4 format starting from revision
294637.

In order to enable debug info macros you can use -fdebug-macro flag with -g.
In fact, this flag will work with all debug info flags other than -g0.

If we want to be compatible with GCC, we need to enable debug info macros when
using -g3.
To do that,  we need to map "-g3" to "-cc1 -debug-info-macro -debug-info-
kind=standalone".

I am not planing to do that though.

Regards,
Amjad