20#include "llvm/ADT/StringExtras.h"
21#include "llvm/Support/Endian.h"
22#include "llvm/Support/FileSystem.h"
23#include "llvm/Support/Path.h"
32#define LLDB_PROPERTIES_symbollocatorsymstore
33#include "SymbolLocatorSymStoreProperties.inc"
36#define LLDB_PROPERTIES_symbollocatorsymstore
37#include "SymbolLocatorSymStorePropertiesEnum.inc"
42 static llvm::StringRef GetSettingName() {
47 m_collection_sp = std::make_shared<OptionValueProperties>(GetSettingName());
48 m_collection_sp->Initialize(g_symbollocatorsymstore_properties_def);
51 Args GetURLs()
const {
53 m_collection_sp->GetPropertyAtIndexAsArgs(ePropertySymStoreURLs, urls);
61 static PluginProperties g_settings;
77 debugger, PluginProperties::GetSettingName())) {
78 constexpr bool is_global_setting =
true;
81 "Properties for the SymStore Symbol Locator plug-in.",
91 return "Symbol locator for PDB in SymStore";
106 llvm::ArrayRef<uint8_t> bytes = uuid.
GetBytes();
107 uint32_t age = llvm::support::endian::read32be(bytes.data() + 16);
108 constexpr bool LowerCase =
false;
109 return llvm::toHex(bytes.slice(0, 16), LowerCase) + std::to_string(age);
120 std::string pdb_name =
122 if (pdb_name.empty()) {
123 LLDB_LOGV(log,
"Failed to resolve symbol PDB module: PDB name empty");
127 LLDB_LOGV(log,
"LocateExecutableSymbolFile {0} with UUID {1}", pdb_name,
130 LLDB_LOGV(log,
"Failed to resolve symbol PDB module: UUID invalid");
137 llvm::SmallString<256> path;
138 llvm::sys::path::append(path, url.ref(), pdb_name, key, pdb_name);
141 LLDB_LOGV(log,
"Found {0} in SymStore {1}", pdb_name, url.ref());
static PluginProperties & GetGlobalPluginProperties()
#define LLDB_LOGV(log,...)
#define LLDB_PLUGIN_DEFINE(PluginName)
static PluginProperties & GetGlobalPluginProperties()
static std::string formatSymStoreKey(const UUID &uuid)
A command line argument class.
llvm::StringRef GetStringRef() const
Get the string value as a llvm::StringRef.
A class to manage flag bits.
const ConstString & GetFilename() const
Filename string const get accessor.
static FileSystem & Instance()
static ModuleListProperties & GetGlobalModuleListProperties()
FileSpec & GetSymbolFileSpec()
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static lldb::OptionValuePropertiesSP GetSettingForSymbolLocatorPlugin(Debugger &debugger, llvm::StringRef setting_name)
static bool UnregisterPlugin(ABICreateInstance create_callback)
static bool CreateSettingForSymbolLocatorPlugin(Debugger &debugger, const lldb::OptionValuePropertiesSP &properties_sp, llvm::StringRef description, bool is_global_property)
This plugin implements lookup in Microsoft SymStore instances.
static void DebuggerInitialize(Debugger &debugger)
static lldb_private::SymbolLocator * CreateInstance()
static llvm::StringRef GetPluginNameStatic()
static llvm::StringRef GetPluginDescriptionStatic()
static std::optional< FileSpec > LocateExecutableSymbolFile(const ModuleSpec &module_spec, const FileSpecList &default_search_paths)
Represents UUID's of various sizes.
llvm::ArrayRef< uint8_t > GetBytes() const
std::string GetAsString(llvm::StringRef separator="-") const
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.