From 978fbff11bb048b8960284c253a9b62264025fff Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Thu, 23 Aug 2012 07:10:46 +0000 Subject: [PATCH] Add an option for darwin gdb compatibility. llvm-svn: 162432 --- llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp index 649684adbf04..02d86c7ad25d 100644 --- a/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp @@ -58,6 +58,10 @@ static cl::opt DwarfAccelTables("dwarf-accel-tables", cl::Hidden, cl::desc("Output prototype dwarf accelerator tables."), cl::init(false)); +static cl::opt 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 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Module *M) 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);