[LLVMbugs] [Bug 23636] New: clang needs -fvar-tracking{-assignments} like gcc

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri May 22 09:26:33 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=23636

            Bug ID: 23636
           Summary: clang needs -fvar-tracking{-assignments} like gcc
           Product: clang
           Version: 3.6
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Driver
          Assignee: unassignedclangbugs at nondot.org
          Reporter: yanegomi at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

clang currently optimizes code away really quickly, which means that it's
extremely hard to debug code in gdb [7.9] when -O0 is not specified on the
command line (which is unfortunately the default on FreeBSD with both kernel
and userland) and when -g is specified on the command line as well.

I've done some experimentation and it seems that gcc 4.9 and gcc 5.0 support
this well.

I spoke with a colleague and it appears that gcc grew support for additional
flags/DWARF output formats that clang could leverage:
https://gcc.gnu.org/wiki/Var_Tracking_Assignments . It would be really
fantastic if clang supported this so then developers could debug code without
having to jump down into the assembler to figure out where the value for the
variable has gone and then determine what it's currently set to.

My example testcase/results "gatherer" can be found here:
https://github.com/yaneurabeya/scratch/tree/master/testing/freebsd/crashalot/ .
You'll  have to install the following things on FreeBSD 11.0-CURRENT:
- clang33,
- clang34,
- clang35,
- clang36 [base],
- gcc [base]
- gcc48,
- gcc49,
- gcc5
- gdb [base]
- gdb66
- gdb49
Then run "make crash-dummy-test".
Finally, do cd `make -V.OBJDIR` and look at all of the run.*txt files.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150522/8c1fed9d/attachment.html>


More information about the llvm-bugs mailing list