LLDB mainline
ScriptedProcess.cpp
Go to the documentation of this file.
1//===-- ScriptedProcess.cpp -----------------------------------------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#include "ScriptedProcess.h"
10
11#include "lldb/Core/Debugger.h"
12#include "lldb/Core/Module.h"
14
22#include "lldb/Target/Queue.h"
26#include "lldb/Utility/State.h"
27
29
30#include "llvm/Support/Error.h"
31
32#include <string>
33
34using namespace lldb;
35using namespace lldb_private;
36
38
40 return "Scripted Process plug-in.";
41}
42
46
48 llvm::ArrayRef<lldb::ScriptLanguage> supported_languages =
49 llvm::ArrayRef(g_supported_script_languages);
50
51 return llvm::is_contained(supported_languages, language);
52}
53
55 lldb::ListenerSP listener_sp,
56 const FileSpec *file,
57 bool can_connect) {
58 if (!target_sp ||
59 !IsScriptLanguageSupported(target_sp->GetDebugger().GetScriptLanguage()))
60 return nullptr;
61
62 ScriptedMetadata scripted_metadata(target_sp->GetProcessLaunchInfo());
63
64 if (!scripted_metadata)
65 return nullptr;
66
68 auto process_sp = std::shared_ptr<ScriptedProcess>(
69 new ScriptedProcess(target_sp, listener_sp, scripted_metadata, error));
70
71 if (error.Fail() || !process_sp || !process_sp->m_interface_up) {
72 // CreateInstance returns nullptr on failure with no Status output
73 // parameter, so we must report the error via the diagnostic system for
74 // users to see it.
75 if (error.Fail()) {
77 llvm::formatv("failed to create ScriptedProcess: {0}",
78 error.AsCString())
79 .str(),
80 target_sp->GetDebugger().GetID());
81 }
82 LLDB_LOGF(GetLog(LLDBLog::Process), "%s", error.AsCString());
83 return nullptr;
84 }
85
86 return process_sp;
87}
88
90 bool plugin_specified_by_name) {
91 return true;
92}
93
95 lldb::ListenerSP listener_sp,
96 const ScriptedMetadata &scripted_metadata,
98 : Process(target_sp, listener_sp), m_scripted_metadata(scripted_metadata) {
99
100 if (!target_sp) {
102 "ScriptedProcess::%s () - ERROR: %s", __FUNCTION__, "Invalid target");
103 return;
104 }
105
106 ScriptInterpreter *interpreter =
107 target_sp->GetDebugger().GetScriptInterpreter();
108
109 if (!interpreter) {
111 "ScriptedProcess::%s () - ERROR: %s", __FUNCTION__,
112 "Debugger has no Script Interpreter");
113 return;
114 }
115
116 // Create process instance interface
118 if (!m_interface_up) {
120 "ScriptedProcess::%s () - ERROR: %s", __FUNCTION__,
121 "Script interpreter couldn't create Scripted Process Interface");
122 return;
123 }
124
125 ExecutionContext exe_ctx(target_sp, /*get_process=*/false);
126
127 // Create process script object
128 auto obj_or_err =
130
131 if (!obj_or_err) {
132 std::string error_msg = llvm::toString(obj_or_err.takeError());
134 "failed to create script object: {0}", error_msg);
135 return;
136 }
137
138 StructuredData::GenericSP object_sp = *obj_or_err;
139
140 if (!object_sp || !object_sp->IsValid()) {
142 "ScriptedProcess::%s () - ERROR: %s", __FUNCTION__,
143 "Failed to create valid script object");
144 return;
145 }
146}
147
149 Clear();
150 // If the interface is not valid, we can't call Finalize(). When that happens
151 // it means that the Scripted Process instanciation failed and the
152 // CreateProcess function returns a nullptr, so no one besides this class
153 // should have access to that bogus process object.
154 if (!m_interface_up)
155 return;
156 // We need to call finalize on the process before destroying ourselves to
157 // make sure all of the broadcaster cleanup goes as planned. If we destruct
158 // this class, then Process::~Process() might have problems trying to fully
159 // destroy the broadcaster.
160 Finalize(true /* destructing */);
161}
162
167
171
174
175 return DoLaunch(nullptr, launch_info);
176}
177
179 ProcessLaunchInfo &launch_info) {
180 LLDB_LOGF(GetLog(LLDBLog::Process), "ScriptedProcess::%s launching process", __FUNCTION__);
181
182 /* MARK: This doesn't reflect how lldb actually launches a process.
183 In reality, it attaches to debugserver, then resume the process.
184 That's not true in all cases. If debugserver is remote, lldb
185 asks debugserver to launch the process for it. */
188 return error;
189}
190
192
194 // Update the PID again, in case the user provided a placeholder pid at launch
196}
197
199 LLDB_LOGF(GetLog(LLDBLog::Process), "ScriptedProcess::%s resuming process", __FUNCTION__);
200
201 if (direction == RunDirection::eRunForward)
202 return GetInterface().Resume();
203 // FIXME: Pipe reverse continue through Scripted Processes
205 "{0} does not support reverse execution of processes", GetPluginName());
206}
207
209 Status error = GetInterface().Attach(attach_info);
210 if (error.Fail()) {
212 "failed to attach to scripted process: {0}", error.AsCString());
213 return error;
214 }
217 // NOTE: We need to set the PID before finishing to attach otherwise we will
218 // hit an assert when calling the attach completion handler.
219 DidLaunch();
220
221 return {};
222}
223
224Status
226 const ProcessAttachInfo &attach_info) {
227 return DoAttach(attach_info);
228}
229
231 const char *process_name, const ProcessAttachInfo &attach_info) {
232 return DoAttach(attach_info);
233}
234
236 process_arch = GetArchitecture();
237}
238
240
242
244 void *buf, size_t size, Status &error) {
245 lldb::addr_t addr = process_addr.GetValue();
246 lldb::DataExtractorSP data_extractor_sp =
248
249 if (!data_extractor_sp || !data_extractor_sp->HasData() || error.Fail()) {
250 if (error.Fail()) {
252 "Failed to read memory from scripted process at 0x{0:x-}: {1}", addr,
253 error.AsCString());
254 }
255 return 0;
256 }
257
258 offset_t bytes_copied = data_extractor_sp->CopyByteOrderedData(
259 0, data_extractor_sp->GetByteSize(), buf, size, GetByteOrder());
260
261 if (!bytes_copied || bytes_copied == LLDB_INVALID_OFFSET)
263 LLVM_PRETTY_FUNCTION, "Failed to copy read memory to buffer.", error);
264
265 // FIXME: We should use the diagnostic system to report a warning if the
266 // `bytes_copied` is different from `size`.
267
268 return bytes_copied;
269}
270
271size_t ScriptedProcess::DoWriteMemory(lldb::addr_t vm_addr, const void *buf,
272 size_t size, Status &error) {
273 lldb::DataExtractorSP data_extractor_sp = std::make_shared<DataExtractor>(
274 buf, size, GetByteOrder(), GetAddressByteSize());
275
276 if (!data_extractor_sp || !data_extractor_sp->HasData())
277 return 0;
278
279 lldb::offset_t bytes_written =
280 GetInterface().WriteMemoryAtAddress(vm_addr, data_extractor_sp, error);
281
282 if (!bytes_written || bytes_written == LLDB_INVALID_OFFSET) {
283 if (error.Fail()) {
285 "failed to write memory to scripted process at 0x{0:x-}: {1}",
286 vm_addr, error.AsCString());
287 }
289 LLVM_PRETTY_FUNCTION, "Failed to copy write buffer to memory.", error);
290 }
291
292 // FIXME: We should use the diagnostic system to report a warning if the
293 // `bytes_written` is different from `size`.
294
295 return bytes_written;
296}
297
299 assert(bp_site != nullptr);
300
301 if (IsBreakpointSitePhysicallyEnabled(*bp_site)) {
302 return {};
303 }
304
305 if (bp_site->HardwareRequired()) {
307 "Scripted Processes don't support hardware breakpoints");
308 }
309
312
313 return error;
314}
315
319
321 MemoryRegionInfo &region) {
323 if (auto region_or_err =
324 GetInterface().GetMemoryRegionContainingAddress(load_addr, error))
325 region = *region_or_err;
326
327 return error;
328}
329
332 lldb::addr_t address = 0;
333
334 while (auto region_or_err =
335 GetInterface().GetMemoryRegionContainingAddress(address, error)) {
336 if (error.Fail())
337 break;
338
339 MemoryRegionInfo &mem_region = *region_or_err;
340 auto range = mem_region.GetRange();
341 address += range.GetRangeBase() + range.GetByteSize();
342 region_list.push_back(mem_region);
343 }
344
345 return error;
346}
347
349
351 ThreadList &new_thread_list) {
352 // TODO: Implement
353 // This is supposed to get the current set of threads, if any of them are in
354 // old_thread_list then they get copied to new_thread_list, and then any
355 // actually new threads will get added to new_thread_list.
356 m_thread_plans.ClearThreadCache();
357
360
361 if (!thread_info_sp)
363 LLVM_PRETTY_FUNCTION,
364 "Couldn't fetch thread list from Scripted Process.", error);
365
366 // Because `StructuredData::Dictionary` uses a `std::map<ConstString,
367 // ObjectSP>` for storage, each item is sorted based on the key alphabetical
368 // order. Since `GetThreadsInfo` provides thread indices as the key element,
369 // thread info comes ordered alphabetically, instead of numerically, so we
370 // need to sort the thread indices before creating thread.
371
372 StructuredData::ArraySP keys = thread_info_sp->GetKeys();
373
374 std::map<size_t, StructuredData::ObjectSP> sorted_threads;
375 auto sort_keys = [&sorted_threads,
376 &thread_info_sp](StructuredData::Object *item) -> bool {
377 if (!item)
378 return false;
379
380 llvm::StringRef key = item->GetStringValue();
381 size_t idx = 0;
382
383 // Make sure the provided index is actually an integer
384 if (!llvm::to_integer(key, idx))
385 return false;
386
387 sorted_threads[idx] = thread_info_sp->GetValueForKey(key);
388 return true;
389 };
390
391 size_t thread_count = thread_info_sp->GetSize();
392
393 if (!keys->ForEach(sort_keys) || sorted_threads.size() != thread_count)
394 // Might be worth showing the unsorted thread list instead of return early.
396 LLVM_PRETTY_FUNCTION, "Couldn't sort thread list.", error);
397
398 auto create_scripted_thread =
399 [this, &error, &new_thread_list](
400 const std::pair<size_t, StructuredData::ObjectSP> pair) -> bool {
401 size_t idx = pair.first;
402 StructuredData::ObjectSP object_sp = pair.second;
403
404 if (!object_sp)
406 LLVM_PRETTY_FUNCTION, "Invalid thread info object", error);
407
408 auto thread_or_error =
409 ScriptedThread::Create(*this, object_sp->GetAsGeneric());
410
411 if (!thread_or_error) {
413 llvm::formatv("failed to create scripted thread ({0}): {1}", idx,
414 llvm::toString(thread_or_error.takeError()))
415 .str(),
416 GetTarget().GetDebugger().GetID());
417 return false;
418 }
419
420 ThreadSP thread_sp = thread_or_error.get();
421 lldbassert(thread_sp && "Couldn't initialize scripted thread.");
422
423 RegisterContextSP reg_ctx_sp = thread_sp->GetRegisterContext();
424 if (!reg_ctx_sp)
426 LLVM_PRETTY_FUNCTION,
427 llvm::Twine("Invalid Register Context for thread " + llvm::Twine(idx))
428 .str(),
429 error);
430
431 new_thread_list.AddThread(thread_sp);
432
433 return true;
434 };
435
436 llvm::for_each(sorted_threads, create_scripted_thread);
437
438 return new_thread_list.GetSize(false) > 0;
439}
440
442 // Let all threads recover from stopping and do any clean up based on the
443 // previous thread state (if any).
444 m_thread_list.RefreshStateAfterStop();
445}
446
448 info.Clear();
449 info.SetProcessID(GetID());
452 if (module_sp) {
453 const bool add_exe_file_as_first_arg = false;
454 info.SetExecutableFile(GetTarget().GetExecutableModule()->GetFileSpec(),
455 add_exe_file_as_first_arg);
456 }
457 return true;
458}
459
462 BinaryInformationLevel info_level) {
464 auto error_with_message = [&error](llvm::StringRef message) {
465 return ScriptedInterface::ErrorWithMessage<bool>(LLVM_PRETTY_FUNCTION,
466 message.data(), error);
467 };
468
470
471 if (!loaded_images_sp || !loaded_images_sp->GetSize())
473 LLVM_PRETTY_FUNCTION, "No loaded images.", error);
474
475 ModuleList module_list;
476 Target &target = GetTarget();
477
478 auto reload_image = [&target, &module_list, &error_with_message](
479 StructuredData::Object *obj) -> bool {
481
482 if (!dict)
483 return error_with_message("Couldn't cast image object into dictionary.");
484
485 ModuleSpec module_spec;
486
487 bool has_path = dict->HasKey("path");
488 bool has_uuid = dict->HasKey("uuid");
489 if (!has_path && !has_uuid)
490 return error_with_message("Dictionary should have key 'path' or 'uuid'");
491 if (!dict->HasKey("load_addr"))
492 return error_with_message("Dictionary is missing key 'load_addr'");
493
494 llvm::StringRef path = "";
495 if (has_path) {
496 dict->GetValueForKeyAsString("path", path);
497 module_spec.GetFileSpec().SetPath(path);
498 }
499
500 llvm::StringRef uuid = "";
501 if (has_uuid) {
502 dict->GetValueForKeyAsString("uuid", uuid);
503 module_spec.GetUUID().SetFromStringRef(uuid);
504 }
505
508 dict->GetValueForKeyAsInteger("load_addr", load_addr);
509 dict->GetValueForKeyAsInteger("slide", slide);
510 if (load_addr == LLDB_INVALID_ADDRESS)
511 return error_with_message(
512 "Couldn't get valid load address or slide offset.");
513
514 if (slide != LLDB_INVALID_OFFSET)
515 load_addr += slide;
516
517 module_spec.GetArchitecture() = target.GetArchitecture();
518
519 ModuleSP module_sp =
520 target.GetOrCreateModule(module_spec, true /* notify */);
521
522 bool is_placeholder_module = false;
523
524 if (!module_sp) {
525 // Create a placeholder module
526 LLDB_LOGF(
528 "ScriptedProcess::%s unable to locate the matching "
529 "object file path %s, creating a placeholder module at 0x%" PRIx64,
530 __FUNCTION__, path.str().c_str(), load_addr);
531
533 module_spec, load_addr, module_spec.GetFileSpec().MemorySize());
534
535 is_placeholder_module = true;
536 }
537
538 bool changed = false;
539 module_sp->SetLoadAddress(target, load_addr, false /*=value_is_offset*/,
540 changed);
541
542 if (!changed && !module_sp->GetObjectFile())
543 return error_with_message("Couldn't set the load address for module.");
544
545 FileSpec objfile(path);
546 module_sp->SetFileSpecAndObjectName(objfile,
547 ConstString(objfile.GetFilename()));
548
549 if (is_placeholder_module) {
550 target.GetImages().AppendIfNeeded(module_sp, true /*notify=*/);
551 return true;
552 }
553
554 return module_list.AppendIfNeeded(module_sp);
555 };
556
557 size_t loaded_images_size = loaded_images_sp->GetSize();
558 bool print_error = true;
559 for (size_t idx = 0; idx < loaded_images_size; idx++) {
560 const auto &loaded_image = loaded_images_sp->GetItemAtIndex(idx);
561 if (!reload_image(loaded_image.get()) && print_error) {
562 print_error = false;
564 LLVM_PRETTY_FUNCTION, "Couldn't reload all images.", error);
565 }
566 }
567
568 target.ModulesDidLoad(module_list);
569
570 return loaded_images_sp;
571}
572
575
577 if (!metadata_sp || !metadata_sp->GetSize())
579 LLVM_PRETTY_FUNCTION, "No metadata.", error);
580
581 return metadata_sp;
582}
583
586 for (ThreadSP thread_sp : Threads()) {
587 if (const char *queue_name = thread_sp->GetQueueName()) {
588 QueueSP queue_sp = std::make_shared<Queue>(
589 m_process->shared_from_this(), thread_sp->GetQueueID(), queue_name);
590 m_queue_list.AddQueue(queue_sp);
591 }
592 }
593}
594
599
601 StructuredData::GenericSP object_instance_sp =
603 if (object_instance_sp &&
604 object_instance_sp->GetType() == eStructuredDataTypeGeneric)
605 return object_instance_sp->GetAsGeneric()->GetValue();
606 return nullptr;
607}
static llvm::raw_ostream & error(Stream &strm)
#define lldbassert(x)
Definition LLDBAssert.h:16
#define LLDB_LOGF(log,...)
Definition Log.h:389
#define LLDB_PLUGIN_DEFINE(PluginName)
static constexpr lldb::ScriptLanguage g_supported_script_languages[]
An architecture specification class.
Definition ArchSpec.h:32
Class that manages the actual breakpoint that will be inserted into the running program.
A uniqued constant string class.
Definition ConstString.h:40
static void ReportError(std::string message, std::optional< lldb::user_id_t > debugger_id=std::nullopt, std::once_flag *once=nullptr)
Report error events.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A file utility class.
Definition FileSpec.h:56
void SetPath(llvm::StringRef p)
Temporary helper for FileSystem change.
Definition FileSpec.h:286
llvm::StringRef GetFilename() const
Filename string const get accessor.
Definition FileSpec.h:248
size_t MemorySize() const
Get the memory cost of this object.
Definition FileSpec.cpp:420
A collection class for Module objects.
Definition ModuleList.h:125
bool AppendIfNeeded(const lldb::ModuleSP &new_module, bool notify=true)
Append a module to the module list, if it is not already there.
FileSpec & GetFileSpec()
Definition ModuleSpec.h:57
ArchSpec & GetArchitecture()
Definition ModuleSpec.h:93
A class that describes an executable image and its associated object and symbol files.
Definition Module.h:91
static lldb::ModuleSP CreateModuleFromObjectFile(Args &&...args)
Definition Module.h:136
static bool RegisterPlugin(llvm::StringRef name, llvm::StringRef description, ABICreateInstance create_callback)
static bool UnregisterPlugin(ABICreateInstance create_callback)
An address in a process, qualified by an address space.
lldb::addr_t GetValue() const
void SetExecutableFile(const FileSpec &exe_file, bool add_exe_file_as_first_arg)
void SetArchitecture(const ArchSpec &arch)
Definition ProcessInfo.h:64
void SetProcessID(lldb::pid_t pid)
Definition ProcessInfo.h:68
lldb::pid_t GetID() const
Returns the pid of the process or LLDB_INVALID_PROCESS_ID if there is no known pid.
Definition Process.h:544
Process(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp)
Construct with a shared pointer to a target, and the Process listener.
Definition Process.cpp:453
QueueList m_queue_list
The list of libdispatch queues at a given stop point.
Definition Process.h:3524
bool IsBreakpointSitePhysicallyEnabled(const BreakpointSite &site)
Definition Process.cpp:1676
lldb::ByteOrder GetByteOrder() const
Definition Process.cpp:3928
ThreadList::ThreadIterable Threads()
Definition Process.h:2408
ThreadPlanStackMap m_thread_plans
This is the list of thread plans for threads in m_thread_list, as well as threads we knew existed,...
Definition Process.h:3513
friend class Target
Definition Process.h:366
uint32_t GetAddressByteSize() const
Definition Process.cpp:3932
void SetPrivateState(lldb::StateType state)
Definition Process.cpp:1411
virtual void Finalize(bool destructing)
This object is about to be destroyed, do any necessary cleanup.
Definition Process.cpp:564
ThreadList m_thread_list
The threads for this process as the user will see them.
Definition Process.h:3509
lldb::pid_t m_pid
Definition Process.h:3477
friend class ThreadList
Definition Process.h:367
Target & GetTarget()
Get the target object pointer for this module.
Definition Process.h:1259
virtual lldb::ScriptedProcessInterfaceUP CreateScriptedProcessInterface()
static Ret ErrorWithMessage(llvm::StringRef caller_name, llvm::StringRef user_msg, Status &error, LLDBLog log_category=LLDBLog::Process)
StructuredData::GenericSP GetScriptObjectInstance()
virtual lldb::DataExtractorSP ReadMemoryAtAddress(lldb::addr_t address, size_t size, Status &error)
virtual StructuredData::DictionarySP GetThreadsInfo()
virtual Status Attach(const ProcessAttachInfo &attach_info)
virtual bool CreateBreakpoint(lldb::addr_t addr, Status &error)
virtual StructuredData::DictionarySP GetMetadata()
virtual StructuredData::ArraySP GetLoadedImages()
virtual lldb::offset_t WriteMemoryAtAddress(lldb::addr_t addr, lldb::DataExtractorSP data_sp, Status &error)
virtual llvm::Expected< StructuredData::GenericSP > CreatePluginObject(const ScriptedMetadata &scripted_metadata, ExecutionContext &exe_ctx, StructuredData::Generic *script_obj=nullptr)=0
Status DoAttachToProcessWithID(lldb::pid_t pid, const ProcessAttachInfo &attach_info) override
Attach to an existing process using a process ID.
bool CanDebug(lldb::TargetSP target_sp, bool plugin_specified_by_name) override
Check if a plug-in instance can debug the file in module.
bool DoUpdateThreadList(ThreadList &old_thread_list, ThreadList &new_thread_list) override
Update the thread list following process plug-in's specific logic.
const ScriptedMetadata m_scripted_metadata
size_t DoReadMemory(const ProcessAddress &addr, void *buf, size_t size, Status &error) override
Actually do the reading of memory from a process.
void DidAttach(ArchSpec &process_arch) override
Called after attaching a process.
static llvm::StringRef GetPluginNameStatic()
Status GetMemoryRegions(lldb_private::MemoryRegionInfos &region_list) override
Obtain all the mapped memory regions within this process.
static bool IsScriptLanguageSupported(lldb::ScriptLanguage language)
bool IsAlive() override
Check if a process is still alive.
Status DoAttach(const ProcessAttachInfo &attach_info)
bool GetProcessInfo(ProcessInstanceInfo &info) override
lldb_private::StructuredData::ObjectSP GetLoadedDynamicLibrariesInfos(lldb::BinaryInformationLevel info_level) override
Retrieve a StructuredData dictionary about all of the binaries loaded in the process at this time.
void DidResume() override
Called after resuming a process.
Status DoLaunch(Module *exe_module, ProcessLaunchInfo &launch_info) override
Launch a new process.
size_t DoWriteMemory(lldb::addr_t vm_addr, const void *buf, size_t size, Status &error) override
Actually do the writing of memory to a process.
Status DoResume(lldb::RunDirection direction) override
Resumes all of a process's threads as configured using the Thread run control functions.
ScriptedProcess(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const ScriptedMetadata &scripted_metadata, Status &error)
lldb::ScriptedProcessInterfaceUP m_interface_up
llvm::StringRef GetPluginName() override
Status EnableBreakpointSite(BreakpointSite *bp_site) override
lldb_private::StructuredData::DictionarySP GetMetadata() override
Fetch process defined metadata.
Status DoAttachToProcessWithName(const char *process_name, const ProcessAttachInfo &attach_info) override
Attach to an existing process using a partial process name.
void RefreshStateAfterStop() override
Currently called as part of ShouldStop.
static lldb::ProcessSP CreateInstance(lldb::TargetSP target_sp, lldb::ListenerSP listener_sp, const FileSpec *crash_file_path, bool can_connect)
static llvm::StringRef GetPluginDescriptionStatic()
ScriptedProcessInterface & GetInterface() const
void DidLaunch() override
Called after launching a process.
Status DoGetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info) override
DoGetMemoryRegionInfo is called by GetMemoryRegionInfo after it has removed non address bits from loa...
static llvm::Expected< std::shared_ptr< ScriptedThread > > Create(ScriptedProcess &process, StructuredData::Generic *script_object=nullptr)
An error handling class.
Definition Status.h:118
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Definition Status.cpp:106
static Status FromErrorString(const char *str)
Definition Status.h:141
static Status static Status FromErrorStringWithFormatv(const char *format, Args &&...args)
Definition Status.h:151
virtual lldb::addr_t GetLoadAddress() const
bool GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const
bool GetValueForKeyAsString(llvm::StringRef key, llvm::StringRef &result) const
bool HasKey(llvm::StringRef key) const
std::shared_ptr< Generic > GenericSP
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
std::shared_ptr< Array > ArraySP
const ProcessLaunchInfo & GetProcessLaunchInfo() const
Definition Target.cpp:5806
void ModulesDidLoad(ModuleList &module_list)
This call may preload module symbols, and may do so in parallel depending on the following target set...
Definition Target.cpp:1941
lldb::ModuleSP GetOrCreateModule(const ModuleSpec &module_spec, bool notify, Status *error_ptr=nullptr)
Find a binary on the system and return its Module, or return an existing Module that is already in th...
Definition Target.cpp:2450
lldb::ModuleSP GetExecutableModule()
Gets the module for the main executable.
Definition Target.cpp:1625
const ModuleList & GetImages() const
Get accessor for the images for this process.
Definition Target.h:1254
const ArchSpec & GetArchitecture() const
Definition Target.h:1296
void AddThread(const lldb::ThreadSP &thread_sp)
uint32_t GetSize(bool can_update=true)
bool SetFromStringRef(llvm::StringRef str)
Definition UUID.cpp:101
#define LLDB_INVALID_ADDRESS
#define LLDB_INVALID_OFFSET
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.
Definition Log.h:338
ScriptLanguage
Script interpreter types.
@ eScriptLanguagePython
std::shared_ptr< lldb_private::Queue > QueueSP
RunDirection
Execution directions.
std::shared_ptr< lldb_private::Thread > ThreadSP
uint64_t offset_t
Definition lldb-types.h:86
@ eStateStopped
Process or thread is stopped and can be examined.
@ eStateRunning
Process or thread is running and can't be examined.
std::shared_ptr< lldb_private::Process > ProcessSP
uint64_t pid_t
Definition lldb-types.h:84
std::shared_ptr< lldb_private::Listener > ListenerSP
uint64_t addr_t
Definition lldb-types.h:80
BinaryInformationLevel
When the Process plugin can retrieve information about all binaries loaded in the target process,...
std::shared_ptr< lldb_private::Target > TargetSP
@ eStructuredDataTypeGeneric
std::shared_ptr< lldb_private::RegisterContext > RegisterContextSP
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP
std::shared_ptr< lldb_private::Module > ModuleSP