Skip to content

Commit 2ead82c

Browse files
committed
[clang] [MinGW] Default to DWARF 4
Neither LLDB nor GDB seem to work with DWARF 5 debug information on Windows right now. This applies the same change as in 9c62728 (Default to DWARFv4 on Windows) to the MinGW driver too. Differential Revision: https://reviews.llvm.org/D119326 (cherry picked from commit 6cf64b2)
1 parent e77317a commit 2ead82c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

clang/lib/Driver/ToolChains/MinGW.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ class LLVM_LIBRARY_VISIBILITY MinGW : public ToolChain {
9090

9191
void printVerboseInfo(raw_ostream &OS) const override;
9292

93+
unsigned GetDefaultDwarfVersion() const override { return 4; }
94+
9395
protected:
9496
Tool *getTool(Action::ActionClass AC) const override;
9597
Tool *buildLinker() const override;

clang/test/CodeGen/dwarf-version.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
// Explicitly request both.
3333
// RUN: %clang -target i686-pc-windows-msvc -gdwarf -gcodeview -S -emit-llvm -o - %s \
3434
// RUN: | FileCheck %s --check-prefixes=VER4,CODEVIEW
35+
36+
// Check what version of dwarf is used for MinGW targets.
37+
// RUN: %clang -target i686-pc-windows-gnu -g -S -emit-llvm -o - %s | \
38+
// RUN: FileCheck %s --check-prefixes=VER4
39+
3540
// RUN: %clang -target powerpc-ibm-aix-xcoff -g -S -emit-llvm -o - %s | \
3641
// RUN: FileCheck %s --check-prefix=VER3
3742
// RUN: %clang -target powerpc-ibm-aix-xcoff -gdwarf-2 -S -emit-llvm -o - %s | \

0 commit comments

Comments
 (0)