Revert r314817 "[dwarfdump] Add -lookup option"
The test fails on Linux; see follow-up email on the llvm-commits list.
> Add the option to lookup an address in the debug information and print
> out the file, function, block and line table details.
>
> Differential revision: https://reviews.llvm.org/D38409
This also reverts the follow-up r314818:
> [test] Fix llvm-dwarfdump/cmdline.test
>
> Fixes test/tools/llvm-dwarfdump/cmdline.test
llvm-svn: 314825
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
index 24aa666..bf0c4b0 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp
@@ -48,6 +48,7 @@
#include <cstdint>
#include <map>
#include <string>
+#include <tuple>
#include <utility>
#include <vector>
@@ -722,35 +723,6 @@
return getCompileUnitForOffset(CUOffset);
}
-DWARFContext::DIEsForAddress DWARFContext::getDIEsForAddress(uint64_t Address) {
- DIEsForAddress Result;
-
- DWARFCompileUnit *CU = getCompileUnitForAddress(Address);
- if (!CU)
- return Result;
-
- Result.CompileUnit = CU;
- Result.FunctionDIE = CU->getSubroutineForAddress(Address);
-
- std::vector<DWARFDie> Worklist;
- Worklist.push_back(Result.FunctionDIE);
- while (!Worklist.empty()) {
- DWARFDie DIE = Worklist.back();
- Worklist.pop_back();
-
- if (DIE.getTag() == DW_TAG_lexical_block &&
- DIE.addressRangeContainsAddress(Address)) {
- Result.BlockDIE = DIE;
- break;
- }
-
- for (auto Child : DIE)
- Worklist.push_back(Child);
- }
-
- return Result;
-}
-
static bool getFunctionNameAndStartLineForAddress(DWARFCompileUnit *CU,
uint64_t Address,
FunctionNameKind Kind,
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
index 98e548b..86451fa 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFUnit.cpp
@@ -440,7 +440,7 @@
// NULL DIEs don't have siblings.
if (Die->getAbbreviationDeclarationPtr() == nullptr)
return DWARFDie();
-
+
// Find the next DIE whose depth is the same as the Die's depth.
for (size_t I = getDIEIndex(Die) + 1, EndIdx = DieArray.size(); I < EndIdx;
++I) {