Skip to content

Commit

Permalink
Remove 2 unused methods DWARFDebugInfo::Find and their FindCallbackSt…
Browse files Browse the repository at this point in the history
…ring

Differential revision: https://reviews.llvm.org/D40216

llvm-svn: 318631
  • Loading branch information
jankratochvil committed Nov 19, 2017
1 parent c021892 commit 0f45abd
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 81 deletions.
77 changes: 0 additions & 77 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -507,80 +507,3 @@ void DWARFDebugInfo::Dump(Stream *s, const uint32_t die_offset,
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();
}
4 changes: 0 additions & 4 deletions lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ class DWARFDebugInfo {
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
Expand Down

0 comments on commit 0f45abd

Please sign in to comment.