Lines Matching refs:Target

1 //===-- Target.cpp --------------------------------------------------------===//
9 #include "lldb/Target/Target.h"
45 #include "lldb/Target/ABI.h"
46 #include "lldb/Target/ExecutionContext.h"
47 #include "lldb/Target/Language.h"
48 #include "lldb/Target/LanguageRuntime.h"
49 #include "lldb/Target/Process.h"
50 #include "lldb/Target/RegisterTypeBuilder.h"
51 #include "lldb/Target/SectionLoadList.h"
52 #include "lldb/Target/StackFrame.h"
53 #include "lldb/Target/StackFrameRecognizer.h"
54 #include "lldb/Target/SystemRuntime.h"
55 #include "lldb/Target/Thread.h"
56 #include "lldb/Target/ThreadSpec.h"
57 #include "lldb/Target/UnixSignals.h"
156 Target::Arch::Arch(const ArchSpec &spec)
160 const Target::Arch &Target::Arch::operator=(const ArchSpec &spec) {
166 llvm::StringRef Target::GetStaticBroadcasterClass() {
171 Target::Target(Debugger &debugger, const ArchSpec &target_arch,
175 Target::GetStaticBroadcasterClass().str()),
194 LLDB_LOG(GetLog(LLDBLog::Object), "{0} Target::Target()",
197 LLDB_LOG(GetLog(LLDBLog::Target),
198 "Target::Target created with architecture {0} ({1})",
206 Target::~Target() {
208 LLDB_LOG(log, "{0} Target::~Target()", static_cast<void *>(this));
212 void Target::PrimeFromDummyTarget(Target &target) {
234 void Target::Dump(Stream *s, lldb::DescriptionLevel description_level) {
238 s->PutCString("Target\n");
253 void Target::CleanupProcess() {
269 void Target::DeleteCurrentProcess() {
291 const lldb::ProcessSP &Target::CreateProcess(ListenerSP listener_sp,
303 const lldb::ProcessSP &Target::GetProcessSP() const { return m_process_sp; }
305 lldb::REPLSP Target::GetREPL(Status &err, lldb::LanguageType language,
356 void Target::SetREPL(lldb::LanguageType language, lldb::REPLSP repl_sp) {
362 void Target::Destroy() {
386 llvm::StringRef Target::GetABIName() const {
397 BreakpointList &Target::GetBreakpointList(bool internal) {
404 const BreakpointList &Target::GetBreakpointList(bool internal) const {
411 BreakpointSP Target::GetBreakpointByID(break_id_t break_id) {
423 lldb_private::Target::CreateBreakpointAtUserEntry(Status &error) {
461 BreakpointSP Target::CreateSourceRegexBreakpoint(
478 BreakpointSP Target::CreateBreakpoint(const FileSpecList *containingModules,
536 BreakpointSP Target::CreateBreakpoint(lldb::addr_t addr, bool internal,
556 BreakpointSP Target::CreateBreakpoint(const Address &addr, bool internal,
566 Target::CreateAddressInModuleBreakpoint(lldb::addr_t file_addr, bool internal,
577 BreakpointSP Target::CreateBreakpoint(
601 Target::CreateBreakpoint(const FileSpecList *containingModules,
627 Target::CreateBreakpoint(const FileSpecList *containingModules,
657 Target::GetSearchFilterForModule(const FileSpec *containingModule) {
675 Target::GetSearchFilterForModuleList(const FileSpecList *containingModules) {
692 SearchFilterSP Target::GetSearchFilterForModuleAndCUList(
712 BreakpointSP Target::CreateFuncRegexBreakpoint(
729 Target::CreateExceptionBreakpoint(enum lldb::LanguageType language,
746 lldb::BreakpointSP Target::CreateScriptedBreakpoint(
776 BreakpointSP Target::CreateBreakpoint(SearchFilterSP &filter_sp,
791 void Target::AddBreakpoint(lldb::BreakpointSP bp_sp, bool internal) {
803 LLDB_LOGF(log, "Target::%s (internal = %s) => break_id = %s\n",
814 void Target::AddNameToBreakpoint(BreakpointID &id, llvm::StringRef name,
828 void Target::AddNameToBreakpoint(BreakpointSP &bp_sp, llvm::StringRef name,
841 void Target::AddBreakpointName(std::unique_ptr<BreakpointName> bp_name) {
846 BreakpointName *Target::FindBreakpointName(ConstString name, bool can_create,
870 void Target::DeleteBreakpointName(ConstString name) {
881 void Target::RemoveNameFromBreakpoint(lldb::BreakpointSP &bp_sp,
886 void Target::ConfigureBreakpointName(
894 void Target::ApplyNameToBreakpoints(BreakpointName &bp_name) {
908 void Target::GetBreakpointNames(std::vector<std::string> &names) {
916 bool Target::ProcessIsValid() {
920 static bool CheckIfWatchpointsSupported(Target *target, Status &error) {
931 "Target supports (%u) hardware watchpoint slots.\n",
940 WatchpointSP Target::CreateWatchpoint(lldb::addr_t addr, size_t size,
945 "Target::%s (addr = 0x%8.8" PRIx64 " size = %" PRIu64
1023 LLDB_LOGF(log, "Target::%s (creation of watchpoint %s with id = %u)\n",
1037 void Target::RemoveAllowedBreakpoints() {
1039 LLDB_LOGF(log, "Target::%s \n", __FUNCTION__);
1046 void Target::RemoveAllBreakpoints(bool internal_also) {
1048 LLDB_LOGF(log, "Target::%s (internal_also = %s)\n", __FUNCTION__,
1058 void Target::DisableAllBreakpoints(bool internal_also) {
1060 LLDB_LOGF(log, "Target::%s (internal_also = %s)\n", __FUNCTION__,
1068 void Target::DisableAllowedBreakpoints() {
1070 LLDB_LOGF(log, "Target::%s", __FUNCTION__);
1075 void Target::EnableAllBreakpoints(bool internal_also) {
1077 LLDB_LOGF(log, "Target::%s (internal_also = %s)\n", __FUNCTION__,
1085 void Target::EnableAllowedBreakpoints() {
1087 LLDB_LOGF(log, "Target::%s", __FUNCTION__);
1092 bool Target::RemoveBreakpointByID(break_id_t break_id) {
1094 LLDB_LOGF(log, "Target::%s (break_id = %i, internal = %s)\n", __FUNCTION__,
1112 bool Target::DisableBreakpointByID(break_id_t break_id) {
1114 LLDB_LOGF(log, "Target::%s (break_id = %i, internal = %s)\n", __FUNCTION__,
1130 bool Target::EnableBreakpointByID(break_id_t break_id) {
1132 LLDB_LOGF(log, "Target::%s (break_id = %i, internal = %s)\n", __FUNCTION__,
1149 void Target::ResetBreakpointHitCounts() {
1153 Status Target::SerializeBreakpointsToFile(const FileSpec &file,
1245 Status Target::CreateBreakpointsFromFile(const FileSpec &file,
1251 Status Target::CreateBreakpointsFromFile(const FileSpec &file,
1312 bool Target::RemoveAllWatchpoints(bool end_to_end) {
1314 LLDB_LOGF(log, "Target::%s\n", __FUNCTION__);
1341 bool Target::DisableAllWatchpoints(bool end_to_end) {
1343 LLDB_LOGF(log, "Target::%s\n", __FUNCTION__);
1368 bool Target::EnableAllWatchpoints(bool end_to_end) {
1370 LLDB_LOGF(log, "Target::%s\n", __FUNCTION__);
1394 bool Target::ClearAllWatchpointHitCounts() {
1396 LLDB_LOGF(log, "Target::%s\n", __FUNCTION__);
1408 bool Target::ClearAllWatchpointHistoricValues() {
1410 LLDB_LOGF(log, "Target::%s\n", __FUNCTION__);
1423 bool Target::IgnoreAllWatchpoints(uint32_t ignore_count) {
1425 LLDB_LOGF(log, "Target::%s\n", __FUNCTION__);
1440 bool Target::DisableWatchpointByID(lldb::watch_id_t watch_id) {
1442 LLDB_LOGF(log, "Target::%s (watch_id = %i)\n", __FUNCTION__, watch_id);
1459 bool Target::EnableWatchpointByID(lldb::watch_id_t watch_id) {
1461 LLDB_LOGF(log, "Target::%s (watch_id = %i)\n", __FUNCTION__, watch_id);
1478 bool Target::RemoveWatchpointByID(lldb::watch_id_t watch_id) {
1480 LLDB_LOGF(log, "Target::%s (watch_id = %i)\n", __FUNCTION__, watch_id);
1494 bool Target::IgnoreWatchpointByID(lldb::watch_id_t watch_id,
1497 LLDB_LOGF(log, "Target::%s (watch_id = %i)\n", __FUNCTION__, watch_id);
1510 ModuleSP Target::GetExecutableModule() {
1524 Module *Target::GetExecutableModulePointer() {
1529 Target *target) {
1546 void Target::ClearModules(bool delete_locations) {
1553 void Target::DidExec() {
1559 void Target::SetExecutableModule(ModuleSP &executable_sp,
1561 Log *log = GetLog(LLDBLog::Target);
1566 LLDB_SCOPED_TIMERF("Target::SetExecutableModule (executable = '%s')",
1578 "Target::SetExecutableModule setting architecture to {0} ({1}) "
1668 bool Target::SetArchitecture(const ArchSpec &arch_spec, bool set_platform,
1670 Log *log = GetLog(LLDBLog::Target);
1716 "Target::SetArchitecture merging compatible arch; arch "
1727 "Target::SetArchitecture changing architecture to %s (%s) from %s (%s)",
1740 "Target::SetArchitecture Trying to select executable file "
1757 bool Target::MergeArchitecture(const ArchSpec &arch_spec) {
1758 Log *log = GetLog(LLDBLog::Target);
1765 "Target::MergeArchitecture target has arch %s, merging with "
1782 void Target::NotifyWillClearList(const ModuleList &module_list) {}
1784 void Target::NotifyModuleAdded(const ModuleList &module_list,
1794 void Target::NotifyModuleRemoved(const ModuleList &module_list,
1804 void Target::NotifyModuleUpdated(const ModuleList &module_list,
1816 void Target::NotifyModulesRemoved(lldb_private::ModuleList &module_list) {
1820 void Target::ModulesDidLoad(ModuleList &module_list) {
1840 void Target::SymbolsDidLoad(ModuleList &module_list) {
1856 void Target::ModulesDidUnload(ModuleList &module_list, bool delete_locations) {
1896 bool Target::ModuleIsExcludedForUnconstrainedSearches(
1918 bool Target::ModuleIsExcludedForUnconstrainedSearches(
1928 size_t Target::ReadMemoryFromFileCache(const Address &addr, void *dst,
1962 size_t Target::ReadMemory(const Address &addr, void *dst, size_t dst_len,
2083 size_t Target::ReadCStringFromMemory(const Address &addr, std::string &out_str,
2106 size_t Target::ReadCStringFromMemory(const Address &addr, char *dst,
2160 addr_t Target::GetReasonableReadSize(const Address &addr) {
2173 size_t Target::ReadStringFromMemory(const Address &addr, char *dst,
2222 size_t Target::ReadScalarIntegerFromMemory(const Address &addr, uint32_t byte_size,
2251 uint64_t Target::ReadUnsignedIntegerFromMemory(const Address &addr,
2262 bool Target::ReadPointerFromMemory(const Address &addr, Status &error,
2292 ModuleSP Target::GetOrCreateModule(const ModuleSpec &orig_module_spec,
2487 if (Log *log = GetLog(LLDBLog::Target | LLDBLog::Modules)) {
2533 TargetSP Target::CalculateTarget() { return shared_from_this(); }
2535 ProcessSP Target::CalculateProcess() { return m_process_sp; }
2537 ThreadSP Target::CalculateThread() { return ThreadSP(); }
2539 StackFrameSP Target::CalculateStackFrame() { return StackFrameSP(); }
2541 void Target::CalculateExecutionContext(ExecutionContext &exe_ctx) {
2546 PathMappingList &Target::GetImageSearchPathList() {
2550 void Target::ImageSearchPathsChanged(const PathMappingList &path_list,
2552 Target *target = (Target *)baton;
2559 Target::GetScratchTypeSystemForLanguage(lldb::LanguageType language,
2562 return llvm::createStringError("Invalid Target");
2585 CompilerType Target::GetRegisterType(const std::string &name,
2594 Target::GetScratchTypeSystems(bool create_on_demand) {
2612 GetLog(LLDBLog::Target), type_system_or_err.takeError(),
2629 Target::GetPersistentExpressionStateForLanguage(lldb::LanguageType language) {
2634 GetLog(LLDBLog::Target), std::move(err),
2643 LLDB_LOG(GetLog(LLDBLog::Target),
2649 UserExpression *Target::GetUserExpressionForLanguage(
2682 FunctionCaller *Target::GetFunctionCallerForLanguage(
2712 Target::CreateUtilityFunction(std::string expression, std::string name,
2739 void Target::SettingsInitialize() { Process::SettingsInitialize(); }
2741 void Target::SettingsTerminate() { Process::SettingsTerminate(); }
2743 FileSpecList Target::GetDefaultExecutableSearchPaths() {
2744 return Target::GetGlobalProperties().GetExecutableSearchPaths();
2747 FileSpecList Target::GetDefaultDebugFileSearchPaths() {
2748 return Target::GetGlobalProperties().GetDebugFileSearchPaths();
2751 ArchSpec Target::GetDefaultArchitecture() {
2752 return Target::GetGlobalProperties().GetDefaultArchitecture();
2755 void Target::SetDefaultArchitecture(const ArchSpec &arch) {
2756 LLDB_LOG(GetLog(LLDBLog::Target),
2759 Target::GetGlobalProperties().SetDefaultArchitecture(arch);
2762 llvm::Error Target::SetLabel(llvm::StringRef label) {
2782 Target *Target::GetTargetFromContexts(const ExecutionContext *exe_ctx_ptr,
2788 Target *target = nullptr;
2796 ExpressionResults Target::EvaluateExpression(
2835 LLDB_LOG_ERROR(GetLog(LLDBLog::Target), std::move(err),
2840 LLDB_LOG_ERROR(GetLog(LLDBLog::Target), std::move(err),
2864 lldb::ExpressionVariableSP Target::GetPersistentVariable(ConstString name) {
2883 lldb::addr_t Target::GetPersistentSymbol(ConstString name) {
2903 llvm::Expected<lldb_private::Address> Target::GetEntryPointAddress() {
2937 lldb::addr_t Target::GetCallableLoadAddress(lldb::addr_t load_addr,
2945 lldb::addr_t Target::GetOpcodeLoadAddress(lldb::addr_t load_addr,
2952 lldb::addr_t Target::GetBreakableLoadAddress(lldb::addr_t addr) {
2957 SourceManager &Target::GetSourceManager() {
2963 Target::StopHookSP Target::CreateStopHook(StopHook::StopHookKind kind) {
2965 Target::StopHookSP stop_hook_sp;
2978 void Target::UndoCreateStopHook(lldb::user_id_t user_id) {
2985 bool Target::RemoveStopHookByID(lldb::user_id_t user_id) {
2990 void Target::RemoveAllStopHooks() { m_stop_hooks.clear(); }
2992 Target::StopHookSP Target::GetStopHookByID(lldb::user_id_t user_id) {
3002 bool Target::SetStopHookActiveStateByID(lldb::user_id_t user_id,
3013 void Target::SetAllStopHooksActiveState(bool active_state) {
3020 bool Target::RunStopHooks() {
3189 TargetProperties &Target::GetGlobalProperties() {
3197 Status Target::Install(ProcessLaunchInfo *launch_info) {
3225 bool Target::ResolveLoadAddress(addr_t load_addr, Address &so_addr,
3231 bool Target::ResolveFileAddress(lldb::addr_t file_addr,
3236 bool Target::SetSectionLoadAddress(const SectionSP &section_sp,
3256 size_t Target::UnloadModuleSections(const ModuleList &module_list) {
3266 size_t Target::UnloadModuleSections(const lldb::ModuleSP &module_sp) {
3285 bool Target::SetSectionUnloaded(const lldb::SectionSP &section_sp) {
3295 bool Target::SetSectionUnloaded(const lldb::SectionSP &section_sp,
3307 void Target::ClearAllLoadedSections() { m_section_load_history.Clear(); }
3309 lldb_private::SummaryStatisticsSP Target::GetSummaryStatisticsSPForProviderName(
3315 SummaryStatisticsCache &Target::GetSummaryStatisticsCache() {
3319 void Target::SaveScriptedLaunchInfo(lldb_private::ProcessInfo &process_info) {
3330 Status Target::Launch(ProcessLaunchInfo &launch_info, Stream *stream) {
3333 Log *log = GetLog(LLDBLog::Target);
3335 LLDB_LOGF(log, "Target::%s() called for %s", __FUNCTION__,
3349 "Target::%s the process exists, and its current state is %s",
3352 LLDB_LOGF(log, "Target::%s the process instance doesn't currently exist.",
3393 LLDB_LOGF(log, "Target::%s asking the platform to debug the process",
3407 "Target::%s the platform doesn't know how to debug a "
3494 void Target::SetTrace(const TraceSP &trace_sp) { m_trace_sp = trace_sp; }
3496 TraceSP Target::GetTrace() { return m_trace_sp; }
3498 llvm::Expected<TraceSP> Target::CreateTrace() {
3523 llvm::Expected<TraceSP> Target::GetTraceOrCreate() {
3529 Status Target::Attach(ProcessAttachInfo &attach_info, Stream *stream) {
3616 void Target::FinalizeFileActions(ProcessLaunchInfo &info) {
3695 void Target::AddDummySignal(llvm::StringRef name, LazyBool pass, LazyBool notify,
3710 bool Target::UpdateSignalFromDummy(UnixSignalsSP signals_sp,
3737 bool Target::ResetSignalFromDummy(UnixSignalsSP signals_sp,
3752 void Target::UpdateSignalsFromDummy(UnixSignalsSP signals_sp,
3759 warning_stream_sp->Printf("Target signal '%s' not found in process\n",
3764 void Target::ClearDummySignals(Args &signal_names) {
3789 void Target::PrintDummySignals(Stream &strm, Args &signal_args) {
3819 // Target::StopHook
3820 Target::StopHook::StopHook(lldb::TargetSP target_sp, lldb::user_id_t uid)
3824 Target::StopHook::StopHook(const StopHook &rhs)
3832 void Target::StopHook::SetSpecifier(SymbolContextSpecifier *specifier) {
3836 void Target::StopHook::SetThreadSpecifier(ThreadSpec *specifier) {
3840 bool Target::StopHook::ExecutionContextPasses(const ExecutionContext &exc_ctx) {
3856 void Target::StopHook::GetDescription(Stream &s,
3898 void Target::StopHookCommandLine::GetSubclassDescription(
3916 // Target::StopHookCommandLine
3917 void Target::StopHookCommandLine::SetActionFromString(const std::string &string) {
3921 void Target::StopHookCommandLine::SetActionFromStrings(
3927 Target::StopHook::StopHookResult
3928 Target::StopHookCommandLine::HandleStop(ExecutionContext &exc_ctx,
3961 // Target::StopHookScripted
3962 Status Target::StopHookScripted::SetScriptCallback(
4001 Target::StopHook::StopHookResult
4002 Target::StopHookScripted::HandleStop(ExecutionContext &exc_ctx,
4021 void Target::StopHookScripted::GetSubclassDescription(
4261 Target *target = exe_ctx->GetTargetPtr();
4298 TargetProperties::TargetProperties(Target *target)
4302 OptionValueProperties::CreateLocalCopy(Target::GetGlobalProperties());
5091 // Target::TargetEventData
5093 Target::TargetEventData::TargetEventData(const lldb::TargetSP &target_sp)
5096 Target::TargetEventData::TargetEventData(const lldb::TargetSP &target_sp,
5100 Target::TargetEventData::~TargetEventData() = default;
5102 llvm::StringRef Target::TargetEventData::GetFlavorString() {
5103 return "Target::TargetEventData";
5106 void Target::TargetEventData::Dump(Stream *s) const {
5115 const Target::TargetEventData *
5116 Target::TargetEventData::GetEventDataFromEvent(const Event *event_ptr) {
5126 TargetSP Target::TargetEventData::GetTargetFromEvent(const Event *event_ptr) {
5135 Target::TargetEventData::GetModuleListFromEvent(const Event *event_ptr) {
5143 std::recursive_mutex &Target::GetAPIMutex() {
5152 Target::ReportStatistics(const lldb_private::StatisticsOptions &options) {
5156 void Target::ResetStatistics() { m_stats.Reset(*this); }
5158 bool Target::HasLoadedSections() { return !GetSectionLoadList().IsEmpty(); }
5160 lldb::addr_t Target::GetSectionLoadAddress(const lldb::SectionSP &section_sp) {
5164 void Target::ClearSectionLoadList() { GetSectionLoadList().Clear(); }
5166 void Target::DumpSectionLoadList(Stream &s) {