[llvm-commits] [PATCH] - RFC - Selecting a Dwarf Info version from the command line.

Eric Christopher echristo at gmail.com
Mon Nov 26 15:01:09 PST 2012


Few comments:

+public:
+  enum DebugLevelOptions {
+    DWARF_2 = 2,
+    DWARF_3,
+    DWARF_4,
+    BAD_DEBUG_LEVEL
+  };
+private:

No underscore between the DWARF and number.

-  if (!DD->useDarwinGDBCompat())
+  if (!DD->useDarwinGDBCompat() && DD->getDebugLevel() >=
DwarfDebug::DWARF_4)

While this covers one of the output elements, it doesn't cover that many of
them. I see you put this as a first step, but I'd rather a bit more step at
first. You'll want to go through and enumerate the things in dwarf2,
dwarf3, dwarf4 and make sure that they're covered by the appropriate level
and are tested as such. This is going to be even more important in the
front end where we'll probably have to distinguish (or not emit debug info
for) c++11 features or other changes if you want to do strict compliance.
I'd like to see how you're going to handle the changes in dwarf emission
from the front end as well.

As far as the option handling, I guess it'll work and don't have any
brilliant ideas.

-eric

On Sun, Nov 25, 2012 at 11:43 AM, Pranav Bhandarkar
<pranavb at codeaurora.org>wrote:

> Hi,
>
> In October, there had been a discussion (http://lists.cs.uiuc.edu/**
> pipermail/llvmdev/2012-**October/054543.html<http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-October/054543.html>)
> about DWARF information related backwards compatibility. Rick Foos (he was
> speaking on my behalf too), in the email above, had proposed a mechanism
> for backwards compatibility. Unfortunately, I could not tend to it at that
> time, but now I have been able to. I am attaching two patches here, one for
> LLVM and the other for clang.
>
> 1) The LLVM patch introduces a command line variable DwarfDebugLevel that
> is set to 4 by default. Additionaly, as a first step, this is used in
> CompileUnit:addFlag to gate the use of DW_FORM_flag_present which is a
> DWARF 4 addition that is compatible with DWARF 3.
>
> 2) The second patch is a patch to clang to process the -gdwarf-2/3/4
> flags, which involves setting DwarfDebugLevel using the -dwarf-debug-level
> option for "clang -cc1".
>
> This is an initial proposal. Please comment on what changes are needed. I
> am posting the clang patch here too because I wanted to post both the
> patches in one place. If cfe-commits is a better place to post (or if the
> two patches should be posted on both the lists) please let me know, and
> I'll do that.
>
> Thanks,
> Pranav
> --
> Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation.
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20121126/44d6fd62/attachment.html>


More information about the llvm-commits mailing list