[Lldb-commits] [lldb] r318631 - Remove 2 unused methods DWARFDebugInfo::Find and their FindCallbackString
Jan Kratochvil via lldb-commits
lldb-commits at lists.llvm.org
Sun Nov 19 11:04:24 PST 2017
Author: jankratochvil
Date: Sun Nov 19 11:04:24 2017
New Revision: 318631
URL: http://llvm.org/viewvc/llvm-project?rev=318631&view=rev
Log:
Remove 2 unused methods DWARFDebugInfo::Find and their FindCallbackString
Differential revision: https://reviews.llvm.org/D40216
Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp?rev=318631&r1=318630&r2=318631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp Sun Nov 19 11:04:24 2017
@@ -507,80 +507,3 @@ void DWARFDebugInfo::Dump(Stream *s, con
die.Dump(s, recurse_depth);
}
}
-
-//----------------------------------------------------------------------
-// FindCallbackString
-//
-// A callback function for the static DWARFDebugInfo::Parse() function
-// that gets called each time a compile unit header or debug information
-// entry is successfully parsed.
-//
-// This function will find the die_offset of any items whose DW_AT_name
-// matches the given string
-//----------------------------------------------------------------------
-typedef struct FindCallbackStringInfoTag {
- const char *name;
- bool ignore_case;
- RegularExpression *regex;
- vector<dw_offset_t> &die_offsets;
-} FindCallbackStringInfo;
-
-static dw_offset_t
-FindCallbackString(SymbolFileDWARF *dwarf2Data, DWARFCompileUnit *cu,
- DWARFDebugInfoEntry *die, const dw_offset_t next_offset,
- const uint32_t curr_depth, void *userData) {
- FindCallbackStringInfo *info = (FindCallbackStringInfo *)userData;
-
- if (!die)
- return next_offset;
-
- const char *die_name = die->GetName(dwarf2Data, cu);
- if (!die_name)
- return next_offset;
-
- if (info->regex) {
- if (info->regex->Execute(llvm::StringRef(die_name)))
- info->die_offsets.push_back(die->GetOffset());
- } else {
- if ((info->ignore_case ? strcasecmp(die_name, info->name)
- : strcmp(die_name, info->name)) == 0)
- info->die_offsets.push_back(die->GetOffset());
- }
-
- // Just return the current offset to parse the next CU or DIE entry
- return next_offset;
-}
-
-//----------------------------------------------------------------------
-// Find
-//
-// Finds all DIE that have a specific DW_AT_name attribute by manually
-// searching through the debug information (not using the
-// .debug_pubnames section). The string must match the entire name
-// and case sensitive searches are an option.
-//----------------------------------------------------------------------
-bool DWARFDebugInfo::Find(const char *name, bool ignore_case,
- vector<dw_offset_t> &die_offsets) const {
- die_offsets.clear();
- if (name && name[0]) {
- FindCallbackStringInfo info = {name, ignore_case, NULL, die_offsets};
- DWARFDebugInfo::Parse(m_dwarf2Data, FindCallbackString, &info);
- }
- return !die_offsets.empty();
-}
-
-//----------------------------------------------------------------------
-// Find
-//
-// Finds all DIE that have a specific DW_AT_name attribute by manually
-// searching through the debug information (not using the
-// .debug_pubnames section). The string must match the supplied regular
-// expression.
-//----------------------------------------------------------------------
-bool DWARFDebugInfo::Find(RegularExpression &re,
- vector<dw_offset_t> &die_offsets) const {
- die_offsets.clear();
- FindCallbackStringInfo info = {NULL, false, &re, die_offsets};
- DWARFDebugInfo::Parse(m_dwarf2Data, FindCallbackString, &info);
- return !die_offsets.empty();
-}
Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h?rev=318631&r1=318630&r2=318631&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h Sun Nov 19 11:04:24 2017
@@ -50,10 +50,6 @@ public:
static void Verify(lldb_private::Stream *s, SymbolFileDWARF *dwarf2Data);
static void Dump(lldb_private::Stream *s, SymbolFileDWARF *dwarf2Data,
const uint32_t die_offset, const uint32_t recurse_depth);
- bool Find(const char *name, bool ignore_case,
- std::vector<dw_offset_t> &die_offsets) const;
- bool Find(lldb_private::RegularExpression &re,
- std::vector<dw_offset_t> &die_offsets) const;
enum {
eDumpFlag_Verbose = (1 << 0), // Verbose dumping
More information about the lldb-commits
mailing list