diff options
author | Manman Ren <mren@apple.com> | 2013-02-27 23:21:02 +0000 |
---|---|---|
committer | Manman Ren <mren@apple.com> | 2013-02-27 23:21:02 +0000 |
commit | 21a08a1189df7922de3a89432cf896ed681db5d5 (patch) | |
tree | 3ea676aa2c6e4a9885136eb1f47f534f4eba1e71 /lib | |
parent | 139f50a1a8d985bd950d88cef54a7ee560de9cb9 (diff) | |
download | external_llvm-21a08a1189df7922de3a89432cf896ed681db5d5.zip external_llvm-21a08a1189df7922de3a89432cf896ed681db5d5.tar.gz external_llvm-21a08a1189df7922de3a89432cf896ed681db5d5.tar.bz2 |
Debug Info: for static member variables, always put AT_MIPS_linkage_name to the
definition DIE (TAG_variable), and put AT_MIPS_linkage_name to TAG_member when
DarwinGDBCompat is true.
Darwin GDB needs AT_MIPS_linkage_name at both places to work.
Follow-up patch to r176143.
rdar://problem/13291234
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176220 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp index 59e433b..00b91e7 100644 --- a/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp +++ b/lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp @@ -1349,12 +1349,19 @@ void CompileUnit::createGlobalVariableDIE(const MDNode *N) { // Add linkage name. StringRef LinkageName = GV.getLinkageName(); if (!LinkageName.empty() && isGlobalVariable) { - addString(VariableDIE, dwarf::DW_AT_MIPS_linkage_name, + // From dwarf-4: DIE to which DW_AT_linkage_name may apply include: + // TAG_commono_block, TAG_constant, TAG_entry_point, TAG_subporgram and + // TAG_variable. For static member variables, gcc 4.7 puts + // MIPS_linkage_name on the definition DIE only, but Darwin gdb needs + // MIPS_linkage_name at both places. + // Per discussion with Eric, for static member variables, we put + // MIPS_linkage_name on the definition DIE (TAG_variable) and conditionaly + // put MIPS_linkage_name on TAG_member when DarwinGDBCompat is on. + addString(IsStaticMember && VariableSpecDIE ? + VariableSpecDIE : VariableDIE, dwarf::DW_AT_MIPS_linkage_name, getRealLinkageName(LinkageName)); - // To make old GDB happy, for static member variables, we add - // AT_MIPS_linkage_name to the definition DIE as well. - if (IsStaticMember && VariableSpecDIE) - addString(VariableSpecDIE, dwarf::DW_AT_MIPS_linkage_name, + if (IsStaticMember && VariableSpecDIE && DD->useDarwinGDBCompat()) + addString(VariableDIE, dwarf::DW_AT_MIPS_linkage_name, getRealLinkageName(LinkageName)); } } else if (const ConstantInt *CI = |