LLDB mainline
|
#include "CommandObjectTarget.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/IOHandler.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/Section.h"
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/DataFormatters/ValueObjectPrinter.h"
#include "lldb/Host/OptionParser.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandOptionArgumentTable.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Interpreter/OptionArgParser.h"
#include "lldb/Interpreter/OptionGroupArchitecture.h"
#include "lldb/Interpreter/OptionGroupBoolean.h"
#include "lldb/Interpreter/OptionGroupFile.h"
#include "lldb/Interpreter/OptionGroupFormat.h"
#include "lldb/Interpreter/OptionGroupPlatform.h"
#include "lldb/Interpreter/OptionGroupPythonClassWithDict.h"
#include "lldb/Interpreter/OptionGroupString.h"
#include "lldb/Interpreter/OptionGroupUInt64.h"
#include "lldb/Interpreter/OptionGroupUUID.h"
#include "lldb/Interpreter/OptionGroupValueObjectDisplay.h"
#include "lldb/Interpreter/OptionGroupVariable.h"
#include "lldb/Interpreter/Options.h"
#include "lldb/Symbol/CompileUnit.h"
#include "lldb/Symbol/FuncUnwinders.h"
#include "lldb/Symbol/LineTable.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/UnwindPlan.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/RegisterContext.h"
#include "lldb/Target/SectionLoadList.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadSpec.h"
#include "lldb/Utility/Args.h"
#include "lldb/Utility/ConstString.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/State.h"
#include "lldb/Utility/Stream.h"
#include "lldb/Utility/StructuredData.h"
#include "lldb/Utility/Timer.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-private-enumerations.h"
#include "clang/Frontend/CompilerInstance.h"
#include "clang/Frontend/CompilerInvocation.h"
#include "clang/Frontend/FrontendActions.h"
#include "clang/Serialization/ObjectFilePCHContainerReader.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FormatAdapters.h"
#include "CommandOptions.inc"
Go to the source code of this file.
Macros | |
#define | LLDB_OPTIONS_target_dependents |
#define | LLDB_OPTIONS_target_modules_dump_symtab |
#define | LLDB_OPTIONS_target_modules_dump |
#define | LLDB_OPTIONS_target_modules_dump_separate_debug_info |
#define | LLDB_OPTIONS_target_modules_list |
#define | LLDB_OPTIONS_target_modules_show_unwind |
#define | LLDB_OPTIONS_target_modules_lookup |
#define | LLDB_OPTIONS_target_stop_hook_add |
Functions | |
static void | DumpTargetInfo (uint32_t target_idx, Target *target, const char *prefix_cstr, bool show_stopped_process_status, Stream &strm) |
static uint32_t | DumpTargetList (TargetList &target_list, bool show_stopped_process_status, Stream &strm) |
static void | DumpModuleArchitecture (Stream &strm, Module *module, bool full_triple, uint32_t width) |
static void | DumpModuleUUID (Stream &strm, Module *module) |
static uint32_t | DumpCompileUnitLineTable (CommandInterpreter &interpreter, Stream &strm, Module *module, const FileSpec &file_spec, lldb::DescriptionLevel desc_level) |
static void | DumpFullpath (Stream &strm, const FileSpec *file_spec_ptr, uint32_t width) |
static void | DumpDirectory (Stream &strm, const FileSpec *file_spec_ptr, uint32_t width) |
static void | DumpBasename (Stream &strm, const FileSpec *file_spec_ptr, uint32_t width) |
static size_t | DumpModuleObjfileHeaders (Stream &strm, ModuleList &module_list) |
static void | DumpModuleSymtab (CommandInterpreter &interpreter, Stream &strm, Module *module, SortOrder sort_order, Mangled::NamePreference name_preference) |
static void | DumpModuleSections (CommandInterpreter &interpreter, Stream &strm, Module *module) |
static bool | DumpModuleSymbolFile (Stream &strm, Module *module) |
static bool | GetSeparateDebugInfoList (StructuredData::Array &list, Module *module, bool errors_only) |
static void | DumpDwoFilesTable (Stream &strm, StructuredData::Array &dwo_listings) |
static void | DumpOsoFilesTable (Stream &strm, StructuredData::Array &oso_listings) |
static void | DumpAddress (ExecutionContextScope *exe_scope, const Address &so_addr, bool verbose, bool all_ranges, Stream &strm, std::optional< Stream::HighlightSettings > settings=std::nullopt) |
static bool | LookupAddressInModule (CommandInterpreter &interpreter, Stream &strm, Module *module, uint32_t resolve_mask, lldb::addr_t raw_addr, lldb::addr_t offset, bool verbose, bool all_ranges) |
static uint32_t | LookupSymbolInModule (CommandInterpreter &interpreter, Stream &strm, Module *module, const char *name, bool name_is_regex, bool verbose, bool all_ranges) |
static void | DumpSymbolContextList (ExecutionContextScope *exe_scope, Stream &strm, const SymbolContextList &sc_list, bool verbose, bool all_ranges, std::optional< Stream::HighlightSettings > settings=std::nullopt) |
static size_t | LookupFunctionInModule (CommandInterpreter &interpreter, Stream &strm, Module *module, const char *name, bool name_is_regex, const ModuleFunctionSearchOptions &options, bool verbose, bool all_ranges) |
static size_t | LookupTypeInModule (Target *target, CommandInterpreter &interpreter, Stream &strm, Module *module, const char *name_cstr, bool name_is_regex) |
static size_t | LookupTypeHere (Target *target, CommandInterpreter &interpreter, Stream &strm, Module &module, const char *name_cstr, bool name_is_regex) |
static uint32_t | LookupFileAndLineInModule (CommandInterpreter &interpreter, Stream &strm, Module *module, const FileSpec &file_spec, uint32_t line, bool check_inlines, bool verbose, bool all_ranges) |
static size_t | FindModulesByName (Target *target, const char *module_name, ModuleList &module_list, bool check_global_list) |
#define LLDB_OPTIONS_target_dependents |
Definition at line 156 of file CommandObjectTarget.cpp.
#define LLDB_OPTIONS_target_modules_dump |
Definition at line 2374 of file CommandObjectTarget.cpp.
#define LLDB_OPTIONS_target_modules_dump_separate_debug_info |
Definition at line 2474 of file CommandObjectTarget.cpp.
#define LLDB_OPTIONS_target_modules_dump_symtab |
Definition at line 1941 of file CommandObjectTarget.cpp.
#define LLDB_OPTIONS_target_modules_list |
Definition at line 3109 of file CommandObjectTarget.cpp.
#define LLDB_OPTIONS_target_modules_lookup |
Definition at line 3771 of file CommandObjectTarget.cpp.
#define LLDB_OPTIONS_target_modules_show_unwind |
Definition at line 3431 of file CommandObjectTarget.cpp.
#define LLDB_OPTIONS_target_stop_hook_add |
Definition at line 4682 of file CommandObjectTarget.cpp.
|
static |
Definition at line 1492 of file CommandObjectTarget.cpp.
References lldb_private::Address::Dump(), lldb_private::Address::DumpStyleDetailedSymbolContext, lldb_private::Address::DumpStyleInvalid, lldb_private::Address::DumpStyleModuleWithFileAddress, lldb_private::Address::DumpStyleResolvedDescription, lldb_private::Address::DumpStyleSectionNameOffset, lldb_private::Stream::EOL(), lldb_private::Stream::GetIndentLevel(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), lldb_private::Stream::PutCString(), lldb_private::Stream::SetIndentLevel(), and UINT32_MAX.
Referenced by DumpSymbolContextList(), LookupAddressInModule(), and LookupSymbolInModule().
Definition at line 1333 of file CommandObjectTarget.cpp.
References lldb_private::ConstString::AsCString(), lldb_private::ConstString::Dump(), lldb_private::FileSpec::GetFilename(), and lldb_private::Stream::Printf().
Referenced by CommandObjectTargetModulesList::PrintModule().
|
static |
Definition at line 1271 of file CommandObjectTarget.cpp.
References lldb_private::LineTable::GetDescription(), lldb_private::CommandInterpreter::GetExecutionContext(), lldb_private::FileSpec::GetFilename(), lldb_private::Module::GetFileSpec(), lldb_private::ExecutionContext::GetTargetPtr(), and lldb_private::Module::ResolveSymbolContextsForFileSpec().
Referenced by CommandObjectTargetModulesDumpLineTable::DoExecute().
Definition at line 1319 of file CommandObjectTarget.cpp.
References lldb_private::ConstString::AsCString(), lldb_private::ConstString::Dump(), lldb_private::FileSpec::GetDirectory(), and lldb_private::Stream::Printf().
Referenced by CommandObjectProcessMinidumpDump::DoExecute(), and CommandObjectTargetModulesList::PrintModule().
|
static |
Definition at line 1425 of file CommandObjectTarget.cpp.
References lldb_private::Stream::EOL(), error(), lldb_private::StructuredData::Array::ForEach(), lldb_private::StructuredData::Object::GetAsDictionary(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsInteger(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsString(), lldb_private::Stream::Printf(), and lldb_private::Stream::PutCString().
Referenced by CommandObjectTargetModulesDumpSeparateDebugInfoFiles::DoExecute().
Definition at line 1302 of file CommandObjectTarget.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::FileSpec::Dump(), lldb_private::FileSpec::GetPath(), and lldb_private::Stream::Printf().
Referenced by LookupFileAndLineInModule(), LookupFunctionInModule(), LookupSymbolInModule(), LookupTypeHere(), LookupTypeInModule(), and CommandObjectTargetModulesList::PrintModule().
|
static |
Definition at line 1246 of file CommandObjectTarget.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::ArchSpec::DumpTriple(), lldb_private::Module::GetArchitecture(), lldb_private::ArchSpec::GetArchitectureName(), lldb_private::StreamString::GetString(), lldb_private::Stream::Printf(), and lldb_private::Stream::PutCString().
Referenced by CommandObjectTargetModulesList::PrintModule().
|
static |
Definition at line 1347 of file CommandObjectTarget.cpp.
References lldb_private::ObjectFile::Dump(), lldb_private::Stream::EOL(), lldb_private::Stream::Format(), lldb_private::ModuleList::GetMutex(), lldb_private::ModuleList::GetSize(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), and lldb_private::ModuleList::ModulesNoLocking().
Referenced by CommandObjectTargetModulesDumpObjfile::DoExecute().
|
static |
Definition at line 1385 of file CommandObjectTarget.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::SectionList::Dump(), lldb_private::Module::GetArchitecture(), lldb_private::ArchSpec::GetArchitectureName(), lldb_private::CommandInterpreter::GetExecutionContext(), lldb_private::Stream::GetIndentLevel(), lldb_private::Module::GetSectionList(), lldb_private::Module::GetSpecificationDescription(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::Stream::Printf(), and UINT32_MAX.
Referenced by CommandObjectTargetModulesDumpSections::DoExecute().
Definition at line 1400 of file CommandObjectTarget.cpp.
References lldb_private::Module::GetSymbolFile().
Referenced by CommandObjectTargetModulesDumpSymfile::DoExecute().
|
static |
Definition at line 1375 of file CommandObjectTarget.cpp.
References lldb_private::CommandInterpreter::GetExecutionContext(), lldb_private::Module::GetSymtab(), and lldb_private::ExecutionContext::GetTargetPtr().
Referenced by CommandObjectTargetModulesDumpSymtab::DoExecute().
Definition at line 1264 of file CommandObjectTarget.cpp.
References lldb_private::UUID::Dump(), lldb_private::Module::GetUUID(), lldb_private::UUID::IsValid(), and lldb_private::Stream::PutCString().
Referenced by CommandObjectTargetModulesList::PrintModule().
|
static |
Definition at line 1463 of file CommandObjectTarget.cpp.
References lldb_private::Stream::EOL(), error(), lldb_private::StructuredData::Array::ForEach(), lldb_private::StructuredData::Object::GetAsDictionary(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsInteger(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsString(), lldb_private::Stream::Printf(), and lldb_private::Stream::PutCString().
Referenced by CommandObjectTargetModulesDumpSeparateDebugInfoFiles::DoExecute().
|
static |
Definition at line 1614 of file CommandObjectTarget.cpp.
References DumpAddress(), lldb_private::Stream::EOL(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::Stream::IndentLess(), and lldb_private::Stream::IndentMore().
Referenced by LookupFileAndLineInModule(), and LookupFunctionInModule().
|
static |
Definition at line 75 of file CommandObjectTarget.cpp.
References lldb_private::Stream::AsRawOstream(), lldb_private::ArchSpec::DumpTriple(), lldb_private::Stream::EOL(), lldb_private::Stream::Format(), lldb_private::Target::GetArchitecture(), lldb_private::Target::GetExecutableModulePointer(), lldb_private::Module::GetFileSpec(), lldb_private::Target::GetLabel(), lldb_private::FileSpec::GetPath(), lldb_private::Target::GetPlatform(), lldb_private::Target::GetProcessSP(), lldb_private::ArchSpec::IsValid(), LLDB_INVALID_PROCESS_ID, PATH_MAX, lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), lldb_private::StateAsCString(), and lldb_private::StateIsStoppedState().
Referenced by DumpTargetList().
|
static |
Definition at line 138 of file CommandObjectTarget.cpp.
References DumpTargetInfo(), lldb_private::TargetList::GetNumTargets(), lldb_private::TargetList::GetSelectedTarget(), lldb_private::TargetList::GetTargetAtIndex(), and lldb_private::Stream::PutCString().
Referenced by CommandObjectTargetList::DoExecute(), and CommandObjectTargetSelect::DoExecute().
|
static |
Definition at line 1790 of file CommandObjectTarget.cpp.
References lldb_private::ModuleList::AppendIfNeeded(), lldb_private::ModuleList::FindModules(), lldb_private::ModuleList::FindSharedModules(), lldb_private::Module::GetAllocatedModuleAtIndex(), lldb_private::Module::GetAllocationModuleCollectionMutex(), lldb_private::ModuleSpec::GetArchitecture(), lldb_private::Target::GetArchitecture(), lldb_private::Target::GetImages(), lldb_private::Module::GetNumberAllocatedModules(), lldb_private::ModuleList::GetSize(), and lldb_private::Module::MatchesModuleSpec().
Referenced by CommandObjectTargetModulesLoad::DoExecute(), CommandObjectTargetModulesDumpObjfile::DoExecute(), CommandObjectTargetModulesDumpSymtab::DoExecute(), CommandObjectTargetModulesDumpSections::DoExecute(), CommandObjectTargetModulesDumpClangAST::DoExecute(), CommandObjectTargetModulesDumpSymfile::DoExecute(), CommandObjectTargetModulesDumpSeparateDebugInfoFiles::DoExecute(), CommandObjectTargetModulesList::DoExecute(), and CommandObjectTargetModulesLookup::DoExecute().
|
static |
Definition at line 1410 of file CommandObjectTarget.cpp.
References lldb_private::StructuredData::Array::AddItem(), and lldb_private::Module::GetSymbolFile().
Referenced by CommandObjectTargetModulesDumpSeparateDebugInfoFiles::DoExecute().
|
static |
Definition at line 1516 of file CommandObjectTarget.cpp.
References DumpAddress(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::CommandInterpreter::GetExecutionContext(), lldb_private::Address::GetModule(), lldb_private::Target::GetSectionLoadList(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::SectionLoadList::IsEmpty(), lldb_private::Module::ResolveFileAddress(), and lldb_private::SectionLoadList::ResolveLoadAddress().
Referenced by CommandObjectTargetModulesLookup::LookupInModule().
|
static |
Definition at line 1762 of file CommandObjectTarget.cpp.
References DumpFullpath(), DumpSymbolContextList(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::CommandInterpreter::GetExecutionContext(), lldb_private::Module::GetFileSpec(), lldb_private::Stream::Indent(), lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), and lldb_private::Module::ResolveSymbolContextsForFileSpec().
Referenced by CommandObjectTargetModulesLookup::LookupInModule().
|
static |
Definition at line 1635 of file CommandObjectTarget.cpp.
References DumpFullpath(), DumpSymbolContextList(), lldb_private::Module::FindFunctions(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::CommandInterpreter::GetExecutionContext(), lldb_private::Module::GetFileSpec(), lldb_private::SymbolContextList::GetSize(), lldb_private::Stream::Indent(), lldb_private::Stream::Printf(), and lldb_private::Stream::PutCString().
Referenced by CommandObjectTargetModulesLookup::LookupInModule().
|
static |
Definition at line 1544 of file CommandObjectTarget.cpp.
References lldb_private::Symtab::AppendSymbolIndexesMatchingRegExAndType(), lldb_private::Symtab::AppendSymbolIndexesWithName(), DumpAddress(), DumpFullpath(), lldb_private::Stream::EOL(), lldb::eSymbolTypeAny, lldb_private::Symbol::GetAddressRef(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::Symbol::GetByteSize(), lldb_private::Symbol::GetByteSizeIsValid(), lldb_private::CommandInterpreter::GetDebugger(), lldb_private::Symbol::GetDisplayName(), lldb_private::CommandInterpreter::GetExecutionContext(), lldb_private::Module::GetFileSpec(), lldb_private::Symbol::GetRawValue(), lldb_private::Debugger::GetRegexMatchAnsiPrefix(), lldb_private::Debugger::GetRegexMatchAnsiSuffix(), lldb_private::ConstString::GetStringRef(), lldb_private::Module::GetSymtab(), lldb_private::Debugger::GetUseColor(), lldb_private::Stream::Indent(), lldb_private::Stream::IndentLess(), lldb_private::Stream::IndentMore(), lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), lldb_private::Stream::PutCStringColorHighlighted(), lldb_private::Symtab::SymbolAtIndex(), and lldb_private::Symbol::ValueIsAddress().
Referenced by CommandObjectTargetModulesLookup::LookupInModule().
|
static |
Definition at line 1720 of file CommandObjectTarget.cpp.
References DumpFullpath(), lldb::eDescriptionLevelFull, lldb_private::TypeList::Empty(), lldb_private::Stream::EOL(), lldb_private::Module::FindTypes(), lldb_private::Module::GetFileSpec(), lldb_private::TypeList::GetSize(), lldb_private::TypeList::GetTypeAtIndex(), lldb_private::TypeResults::GetTypeMap(), lldb_private::Stream::Indent(), lldb_private::SymbolContext::module_sp, lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), and lldb_private::SymbolContext::SortTypeList().
Referenced by CommandObjectTargetModulesLookup::LookupHere().
|
static |
Definition at line 1667 of file CommandObjectTarget.cpp.
References DumpFullpath(), lldb::eDescriptionLevelFull, lldb_private::TypeList::Empty(), lldb_private::Stream::EOL(), lldb_private::Module::FindTypes(), lldb_private::Module::GetFileSpec(), lldb_private::TypeList::GetSize(), lldb_private::TypeResults::GetTypeMap(), lldb_private::Stream::Indent(), lldb_private::SymbolContext::module_sp, lldb_private::Stream::Printf(), lldb_private::Stream::PutCString(), lldb_private::SymbolContext::SortTypeList(), and lldb_private::TypeList::Types().
Referenced by CommandObjectTargetModulesLookup::LookupInModule().