Add an option for darwin gdb compatibility.
authorEric Christopher <echristo@apple.com>
Thu, 23 Aug 2012 07:10:46 +0000 (07:10 +0000)
committerEric Christopher <echristo@apple.com>
Thu, 23 Aug 2012 07:10:46 +0000 (07:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162432 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/DwarfDebug.cpp

index 649684adbf04ca633a84d2999e2f6e778f2bde97..02d86c7ad25d7c13366be6fe81a550b5a368dea8 100644 (file)
@@ -58,6 +58,10 @@ static cl::opt<bool> DwarfAccelTables("dwarf-accel-tables", cl::Hidden,
      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 @@ 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);