Add an option for darwin gdb compatibility.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162432 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
index 649684a..02d86c7 100644
--- a/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
+++ b/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
@@ -58,6 +58,10 @@
cl::desc("Output prototype dwarf accelerator tables."),
cl::init(false));
+static cl::opt<bool> DarwinGDBCompat("darwin-gdb-compat", cl::Hidden,
+ cl::desc("Compatibility with Darwin gdb."),
+ cl::init(false));
+
namespace {
const char *DWARFGroupName = "DWARF Emission";
const char *DbgTimerName = "DWARF Debug Writer";
@@ -135,9 +139,12 @@
DwarfDebugRangeSectionSym = DwarfDebugLocSectionSym = 0;
FunctionBeginSym = FunctionEndSym = 0;
- // Turn on accelerator tables for Darwin.
- if (Triple(M->getTargetTriple()).isOSDarwin())
+ // Turn on accelerator tables and older gdb compatibility
+ // for Darwin.
+ if (Triple(M->getTargetTriple()).isOSDarwin()) {
DwarfAccelTables = true;
+ DarwinGDBCompat = true;
+ }
{
NamedRegionTimer T(DbgTimerName, DWARFGroupName, TimePassesIsEnabled);