[Lldb-commits] [PATCH] D40216: #if 0 for DWARFDebugInfo::Find() as it is unused

Jan Kratochvil via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Sun Nov 19 11:05:12 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL318631: Remove 2 unused methods DWARFDebugInfo::Find and their FindCallbackString (authored by jankratochvil).

Changed prior to commit:
  https://reviews.llvm.org/D40216?vs=123479&id=123505#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D40216

Files:
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h


Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
@@ -50,10 +50,6 @@
   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
Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
===================================================================
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -507,80 +507,3 @@
       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();
-}


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40216.123505.patch
Type: text/x-patch
Size: 4120 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20171119/1b18d38b/attachment-0001.bin>


More information about the lldb-commits mailing list