#include "lldb/API/SBTarget.h"
#include "lldb/Utility/Instrumentation.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/lldb-public.h"
#include "lldb/API/SBBreakpoint.h"
#include "lldb/API/SBDebugger.h"
#include "lldb/API/SBEnvironment.h"
#include "lldb/API/SBEvent.h"
#include "lldb/API/SBExpressionOptions.h"
#include "lldb/API/SBFileSpec.h"
#include "lldb/API/SBListener.h"
#include "lldb/API/SBModule.h"
#include "lldb/API/SBModuleSpec.h"
#include "lldb/API/SBProcess.h"
#include "lldb/API/SBSourceManager.h"
#include "lldb/API/SBStream.h"
#include "lldb/API/SBStringList.h"
#include "lldb/API/SBStructuredData.h"
#include "lldb/API/SBSymbolContextList.h"
#include "lldb/API/SBTrace.h"
#include "lldb/Breakpoint/BreakpointID.h"
#include "lldb/Breakpoint/BreakpointIDList.h"
#include "lldb/Breakpoint/BreakpointList.h"
#include "lldb/Breakpoint/BreakpointLocation.h"
#include "lldb/Core/Address.h"
#include "lldb/Core/AddressResolver.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/Disassembler.h"
#include "lldb/Core/Module.h"
#include "lldb/Core/ModuleSpec.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/SearchFilter.h"
#include "lldb/Core/Section.h"
#include "lldb/Core/StructuredDataImpl.h"
#include "lldb/Core/ValueObjectConstResult.h"
#include "lldb/Core/ValueObjectList.h"
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/Host/Host.h"
#include "lldb/Symbol/DeclVendor.h"
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolFile.h"
#include "lldb/Symbol/SymbolVendor.h"
#include "lldb/Symbol/TypeSystem.h"
#include "lldb/Symbol/VariableList.h"
#include "lldb/Target/ABI.h"
#include "lldb/Target/Language.h"
#include "lldb/Target/LanguageRuntime.h"
#include "lldb/Target/Process.h"
#include "lldb/Target/StackFrame.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/TargetList.h"
#include "lldb/Utility/ArchSpec.h"
#include "lldb/Utility/Args.h"
#include "lldb/Utility/FileSpec.h"
#include "lldb/Utility/ProcessInfo.h"
#include "lldb/Utility/RegularExpression.h"
#include "Commands/CommandObjectBreakpoint.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "llvm/Support/PrettyStackTrace.h"
#include "llvm/Support/Regex.h"
usingnamespacelldb;
usingnamespacelldb_private;
#define DEFAULT_DISASM_BYTE_SIZE …
static Status AttachToProcess(ProcessAttachInfo &attach_info, Target &target) { … }
SBTarget::SBTarget() { … }
SBTarget::SBTarget(const SBTarget &rhs) : … { … }
SBTarget::SBTarget(const TargetSP &target_sp) : … { … }
const SBTarget &SBTarget::operator=(const SBTarget &rhs) { … }
SBTarget::~SBTarget() = default;
bool SBTarget::EventIsTargetEvent(const SBEvent &event) { … }
SBTarget SBTarget::GetTargetFromEvent(const SBEvent &event) { … }
uint32_t SBTarget::GetNumModulesFromEvent(const SBEvent &event) { … }
SBModule SBTarget::GetModuleAtIndexFromEvent(const uint32_t idx,
const SBEvent &event) { … }
const char *SBTarget::GetBroadcasterClassName() { … }
bool SBTarget::IsValid() const { … }
operator bool()
SBProcess SBTarget::GetProcess() { … }
SBPlatform SBTarget::GetPlatform() { … }
SBDebugger SBTarget::GetDebugger() const { … }
SBStructuredData SBTarget::GetStatistics() { … }
SBStructuredData SBTarget::GetStatistics(SBStatisticsOptions options) { … }
void SBTarget::SetCollectingStats(bool v) { … }
bool SBTarget::GetCollectingStats() { … }
SBProcess SBTarget::LoadCore(const char *core_file) { … }
SBProcess SBTarget::LoadCore(const char *core_file, lldb::SBError &error) { … }
SBProcess SBTarget::LaunchSimple(char const **argv, char const **envp,
const char *working_directory) { … }
SBError SBTarget::Install() { … }
SBProcess SBTarget::Launch(SBListener &listener, char const **argv,
char const **envp, const char *stdin_path,
const char *stdout_path, const char *stderr_path,
const char *working_directory,
uint32_t launch_flags,
bool stop_at_entry, lldb::SBError &error) { … }
SBProcess SBTarget::Launch(SBLaunchInfo &sb_launch_info, SBError &error) { … }
lldb::SBProcess SBTarget::Attach(SBAttachInfo &sb_attach_info, SBError &error) { … }
lldb::SBProcess SBTarget::AttachToProcessWithID(
SBListener &listener,
lldb::pid_t pid,
SBError &error
) { … }
lldb::SBProcess SBTarget::AttachToProcessWithName(
SBListener &listener,
const char *name,
bool wait_for,
SBError &error
) { … }
lldb::SBProcess SBTarget::ConnectRemote(SBListener &listener, const char *url,
const char *plugin_name,
SBError &error) { … }
SBFileSpec SBTarget::GetExecutable() { … }
bool SBTarget::operator==(const SBTarget &rhs) const { … }
bool SBTarget::operator!=(const SBTarget &rhs) const { … }
lldb::TargetSP SBTarget::GetSP() const { … }
void SBTarget::SetSP(const lldb::TargetSP &target_sp) { … }
lldb::SBAddress SBTarget::ResolveLoadAddress(lldb::addr_t vm_addr) { … }
lldb::SBAddress SBTarget::ResolveFileAddress(lldb::addr_t file_addr) { … }
lldb::SBAddress SBTarget::ResolvePastLoadAddress(uint32_t stop_id,
lldb::addr_t vm_addr) { … }
SBSymbolContext
SBTarget::ResolveSymbolContextForAddress(const SBAddress &addr,
uint32_t resolve_scope) { … }
size_t SBTarget::ReadMemory(const SBAddress addr, void *buf, size_t size,
lldb::SBError &error) { … }
SBBreakpoint SBTarget::BreakpointCreateByLocation(const char *file,
uint32_t line) { … }
SBBreakpoint
SBTarget::BreakpointCreateByLocation(const SBFileSpec &sb_file_spec,
uint32_t line) { … }
SBBreakpoint
SBTarget::BreakpointCreateByLocation(const SBFileSpec &sb_file_spec,
uint32_t line, lldb::addr_t offset) { … }
SBBreakpoint
SBTarget::BreakpointCreateByLocation(const SBFileSpec &sb_file_spec,
uint32_t line, lldb::addr_t offset,
SBFileSpecList &sb_module_list) { … }
SBBreakpoint SBTarget::BreakpointCreateByLocation(
const SBFileSpec &sb_file_spec, uint32_t line, uint32_t column,
lldb::addr_t offset, SBFileSpecList &sb_module_list) { … }
SBBreakpoint SBTarget::BreakpointCreateByLocation(
const SBFileSpec &sb_file_spec, uint32_t line, uint32_t column,
lldb::addr_t offset, SBFileSpecList &sb_module_list,
bool move_to_nearest_code) { … }
SBBreakpoint SBTarget::BreakpointCreateByName(const char *symbol_name,
const char *module_name) { … }
lldb::SBBreakpoint
SBTarget::BreakpointCreateByName(const char *symbol_name,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list) { … }
lldb::SBBreakpoint SBTarget::BreakpointCreateByName(
const char *symbol_name, uint32_t name_type_mask,
const SBFileSpecList &module_list, const SBFileSpecList &comp_unit_list) { … }
lldb::SBBreakpoint SBTarget::BreakpointCreateByName(
const char *symbol_name, uint32_t name_type_mask,
LanguageType symbol_language, const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list) { … }
lldb::SBBreakpoint SBTarget::BreakpointCreateByNames(
const char *symbol_names[], uint32_t num_names, uint32_t name_type_mask,
const SBFileSpecList &module_list, const SBFileSpecList &comp_unit_list) { … }
lldb::SBBreakpoint SBTarget::BreakpointCreateByNames(
const char *symbol_names[], uint32_t num_names, uint32_t name_type_mask,
LanguageType symbol_language, const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list) { … }
lldb::SBBreakpoint SBTarget::BreakpointCreateByNames(
const char *symbol_names[], uint32_t num_names, uint32_t name_type_mask,
LanguageType symbol_language, lldb::addr_t offset,
const SBFileSpecList &module_list, const SBFileSpecList &comp_unit_list) { … }
SBBreakpoint SBTarget::BreakpointCreateByRegex(const char *symbol_name_regex,
const char *module_name) { … }
lldb::SBBreakpoint
SBTarget::BreakpointCreateByRegex(const char *symbol_name_regex,
const SBFileSpecList &module_list,
const SBFileSpecList &comp_unit_list) { … }
lldb::SBBreakpoint SBTarget::BreakpointCreateByRegex(
const char *symbol_name_regex, LanguageType symbol_language,
const SBFileSpecList &module_list, const SBFileSpecList &comp_unit_list) { … }
SBBreakpoint SBTarget::BreakpointCreateByAddress(addr_t address) { … }
SBBreakpoint SBTarget::BreakpointCreateBySBAddress(SBAddress &sb_address) { … }
lldb::SBBreakpoint
SBTarget::BreakpointCreateBySourceRegex(const char *source_regex,
const lldb::SBFileSpec &source_file,
const char *module_name) { … }
lldb::SBBreakpoint SBTarget::BreakpointCreateBySourceRegex(
const char *source_regex, const SBFileSpecList &module_list,
const lldb::SBFileSpecList &source_file_list) { … }
lldb::SBBreakpoint SBTarget::BreakpointCreateBySourceRegex(
const char *source_regex, const SBFileSpecList &module_list,
const lldb::SBFileSpecList &source_file_list,
const SBStringList &func_names) { … }
lldb::SBBreakpoint
SBTarget::BreakpointCreateForException(lldb::LanguageType language,
bool catch_bp, bool throw_bp) { … }
lldb::SBBreakpoint SBTarget::BreakpointCreateFromScript(
const char *class_name, SBStructuredData &extra_args,
const SBFileSpecList &module_list, const SBFileSpecList &file_list,
bool request_hardware) { … }
uint32_t SBTarget::GetNumBreakpoints() const { … }
SBBreakpoint SBTarget::GetBreakpointAtIndex(uint32_t idx) const { … }
bool SBTarget::BreakpointDelete(break_id_t bp_id) { … }
SBBreakpoint SBTarget::FindBreakpointByID(break_id_t bp_id) { … }
bool SBTarget::FindBreakpointsByName(const char *name,
SBBreakpointList &bkpts) { … }
void SBTarget::GetBreakpointNames(SBStringList &names) { … }
void SBTarget::DeleteBreakpointName(const char *name) { … }
bool SBTarget::EnableAllBreakpoints() { … }
bool SBTarget::DisableAllBreakpoints() { … }
bool SBTarget::DeleteAllBreakpoints() { … }
lldb::SBError SBTarget::BreakpointsCreateFromFile(SBFileSpec &source_file,
SBBreakpointList &new_bps) { … }
lldb::SBError SBTarget::BreakpointsCreateFromFile(SBFileSpec &source_file,
SBStringList &matching_names,
SBBreakpointList &new_bps) { … }
lldb::SBError SBTarget::BreakpointsWriteToFile(SBFileSpec &dest_file) { … }
lldb::SBError SBTarget::BreakpointsWriteToFile(SBFileSpec &dest_file,
SBBreakpointList &bkpt_list,
bool append) { … }
uint32_t SBTarget::GetNumWatchpoints() const { … }
SBWatchpoint SBTarget::GetWatchpointAtIndex(uint32_t idx) const { … }
bool SBTarget::DeleteWatchpoint(watch_id_t wp_id) { … }
SBWatchpoint SBTarget::FindWatchpointByID(lldb::watch_id_t wp_id) { … }
lldb::SBWatchpoint SBTarget::WatchAddress(lldb::addr_t addr, size_t size,
bool read, bool modify,
SBError &error) { … }
lldb::SBWatchpoint
SBTarget::WatchpointCreateByAddress(lldb::addr_t addr, size_t size,
SBWatchpointOptions options,
SBError &error) { … }
bool SBTarget::EnableAllWatchpoints() { … }
bool SBTarget::DisableAllWatchpoints() { … }
SBValue SBTarget::CreateValueFromAddress(const char *name, SBAddress addr,
SBType type) { … }
lldb::SBValue SBTarget::CreateValueFromData(const char *name, lldb::SBData data,
lldb::SBType type) { … }
lldb::SBValue SBTarget::CreateValueFromExpression(const char *name,
const char *expr) { … }
bool SBTarget::DeleteAllWatchpoints() { … }
void SBTarget::AppendImageSearchPath(const char *from, const char *to,
lldb::SBError &error) { … }
lldb::SBModule SBTarget::AddModule(const char *path, const char *triple,
const char *uuid_cstr) { … }
lldb::SBModule SBTarget::AddModule(const char *path, const char *triple,
const char *uuid_cstr, const char *symfile) { … }
lldb::SBModule SBTarget::AddModule(const SBModuleSpec &module_spec) { … }
bool SBTarget::AddModule(lldb::SBModule &module) { … }
uint32_t SBTarget::GetNumModules() const { … }
void SBTarget::Clear() { … }
SBModule SBTarget::FindModule(const SBFileSpec &sb_file_spec) { … }
SBSymbolContextList SBTarget::FindCompileUnits(const SBFileSpec &sb_file_spec) { … }
lldb::ByteOrder SBTarget::GetByteOrder() { … }
const char *SBTarget::GetTriple() { … }
const char *SBTarget::GetABIName() { … }
const char *SBTarget::GetLabel() const { … }
SBError SBTarget::SetLabel(const char *label) { … }
uint32_t SBTarget::GetDataByteSize() { … }
uint32_t SBTarget::GetCodeByteSize() { … }
uint32_t SBTarget::GetMaximumNumberOfChildrenToDisplay() const { … }
uint32_t SBTarget::GetAddressByteSize() { … }
SBModule SBTarget::GetModuleAtIndex(uint32_t idx) { … }
bool SBTarget::RemoveModule(lldb::SBModule module) { … }
SBBroadcaster SBTarget::GetBroadcaster() const { … }
bool SBTarget::GetDescription(SBStream &description,
lldb::DescriptionLevel description_level) { … }
lldb::SBSymbolContextList SBTarget::FindFunctions(const char *name,
uint32_t name_type_mask) { … }
lldb::SBSymbolContextList SBTarget::FindGlobalFunctions(const char *name,
uint32_t max_matches,
MatchType matchtype) { … }
lldb::SBType SBTarget::FindFirstType(const char *typename_cstr) { … }
SBType SBTarget::GetBasicType(lldb::BasicType type) { … }
lldb::SBTypeList SBTarget::FindTypes(const char *typename_cstr) { … }
SBValueList SBTarget::FindGlobalVariables(const char *name,
uint32_t max_matches) { … }
SBValueList SBTarget::FindGlobalVariables(const char *name,
uint32_t max_matches,
MatchType matchtype) { … }
lldb::SBValue SBTarget::FindFirstGlobalVariable(const char *name) { … }
SBSourceManager SBTarget::GetSourceManager() { … }
lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
uint32_t count) { … }
lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
uint32_t count,
const char *flavor_string) { … }
lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress start_addr,
lldb::SBAddress end_addr,
const char *flavor_string) { … }
lldb::SBInstructionList SBTarget::GetInstructions(lldb::SBAddress base_addr,
const void *buf,
size_t size) { … }
lldb::SBInstructionList
SBTarget::GetInstructionsWithFlavor(lldb::SBAddress base_addr,
const char *flavor_string, const void *buf,
size_t size) { … }
lldb::SBInstructionList SBTarget::GetInstructions(lldb::addr_t base_addr,
const void *buf,
size_t size) { … }
lldb::SBInstructionList
SBTarget::GetInstructionsWithFlavor(lldb::addr_t base_addr,
const char *flavor_string, const void *buf,
size_t size) { … }
SBError SBTarget::SetSectionLoadAddress(lldb::SBSection section,
lldb::addr_t section_base_addr) { … }
SBError SBTarget::ClearSectionLoadAddress(lldb::SBSection section) { … }
SBError SBTarget::SetModuleLoadAddress(lldb::SBModule module,
int64_t slide_offset) { … }
SBError SBTarget::SetModuleLoadAddress(lldb::SBModule module,
uint64_t slide_offset) { … }
SBError SBTarget::ClearModuleLoadAddress(lldb::SBModule module) { … }
lldb::SBSymbolContextList SBTarget::FindSymbols(const char *name,
lldb::SymbolType symbol_type) { … }
lldb::SBValue SBTarget::EvaluateExpression(const char *expr) { … }
lldb::SBValue SBTarget::EvaluateExpression(const char *expr,
const SBExpressionOptions &options) { … }
lldb::addr_t SBTarget::GetStackRedZoneSize() { … }
bool SBTarget::IsLoaded(const SBModule &module) const { … }
lldb::SBLaunchInfo SBTarget::GetLaunchInfo() const { … }
void SBTarget::SetLaunchInfo(const lldb::SBLaunchInfo &launch_info) { … }
SBEnvironment SBTarget::GetEnvironment() { … }
lldb::SBTrace SBTarget::GetTrace() { … }
lldb::SBTrace SBTarget::CreateTrace(lldb::SBError &error) { … }