LLDB mainline
ExecutionContext.cpp
Go to the documentation of this file.
1//===-- ExecutionContext.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
11#include "lldb/Target/Process.h"
13#include "lldb/Target/Target.h"
14#include "lldb/Target/Thread.h"
16#include "lldb/Utility/State.h"
17#include <mutex>
18
19using namespace lldb_private;
20
23
25
27 bool get_process)
29 if (target_sp)
30 SetContext(target_sp, get_process);
31}
32
35 if (process_sp)
36 SetContext(process_sp);
37}
38
40 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
41 if (thread_sp)
42 SetContext(thread_sp);
43}
44
46 : m_target_sp(), m_process_sp(), m_thread_sp(), m_frame_sp() {
47 if (frame_sp)
48 SetContext(frame_sp);
49}
50
52 bool get_process)
54 lldb::TargetSP target_sp(target_wp.lock());
55 if (target_sp)
56 SetContext(target_sp, get_process);
57}
58
61 lldb::ProcessSP process_sp(process_wp.lock());
62 if (process_sp)
63 SetContext(process_sp);
64}
65
68 lldb::ThreadSP thread_sp(thread_wp.lock());
69 if (thread_sp)
70 SetContext(thread_sp);
71}
72
75 lldb::StackFrameSP frame_sp(frame_wp.lock());
76 if (frame_sp)
77 SetContext(frame_sp);
78}
79
81 bool fill_current_process_thread_frame)
83 if (t) {
84 m_target_sp = t->shared_from_this();
85 if (fill_current_process_thread_frame) {
87 if (m_process_sp) {
88 m_thread_sp = m_process_sp->GetThreadList().GetSelectedThread();
89 if (m_thread_sp)
92 }
93 }
94 }
95}
96
98 StackFrame *frame)
100 if (process) {
101 m_process_sp = process->shared_from_this();
102 m_target_sp = process->GetTarget().shared_from_this();
103 }
104 if (thread)
105 m_thread_sp = thread->shared_from_this();
106 if (frame)
107 m_frame_sp = frame->shared_from_this();
108}
109
111 : m_target_sp(exe_ctx_ref.GetTargetSP()),
112 m_process_sp(exe_ctx_ref.GetProcessSP()),
113 m_thread_sp(exe_ctx_ref.GetThreadSP()),
114 m_frame_sp(exe_ctx_ref.GetFrameSP()) {}
115
117 bool thread_and_frame_only_if_stopped)
119 if (exe_ctx_ref_ptr) {
120 m_target_sp = exe_ctx_ref_ptr->GetTargetSP();
121 m_process_sp = exe_ctx_ref_ptr->GetProcessSP();
122 if (!thread_and_frame_only_if_stopped ||
123 (m_process_sp && StateIsStoppedState(m_process_sp->GetState(), true))) {
124 m_thread_sp = exe_ctx_ref_ptr->GetThreadSP();
125 m_frame_sp = exe_ctx_ref_ptr->GetFrameSP();
126 }
127 }
128}
129
130llvm::Expected<StoppedExecutionContext>
132 const lldb::ExecutionContextRefSP &exe_ctx_ref_ptr) {
133 return GetStoppedExecutionContext(exe_ctx_ref_ptr.get());
134}
135
136llvm::Expected<StoppedExecutionContext>
138 const ExecutionContextRef *exe_ctx_ref_ptr) {
139 if (!exe_ctx_ref_ptr)
140 return llvm::createStringError(
141 "StoppedExecutionContext created with an empty ExecutionContextRef");
142
143 lldb::TargetSP target_sp = exe_ctx_ref_ptr->GetTargetSP();
144 if (!target_sp)
145 return llvm::createStringError(
146 "StoppedExecutionContext created with a null target");
147
148 auto api_lock =
149 std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
150
151 auto process_sp = exe_ctx_ref_ptr->GetProcessSP();
152 if (!process_sp)
153 return llvm::createStringError(
154 "StoppedExecutionContext created with a null process");
155
157 if (!stop_locker.TryLock(&process_sp->GetRunLock()))
158 return llvm::createStringError(
159 "attempted to create a StoppedExecutionContext with a running process");
160
161 auto thread_sp = exe_ctx_ref_ptr->GetThreadSP();
162 auto frame_sp = exe_ctx_ref_ptr->GetFrameSP();
163
164 if (!frame_sp && exe_ctx_ref_ptr->m_frame_list_id) {
165 return llvm::createStringError(
166 "attempted to create a StoppedExecutionContext but "
167 "ScriptedFrameProvider (name = %s - id = %u) is no longer available",
168 exe_ctx_ref_ptr->m_frame_list_id->first.GetName().str().c_str(),
169 exe_ctx_ref_ptr->m_frame_list_id->second);
170 }
171
172 return StoppedExecutionContext(target_sp, process_sp, thread_sp, frame_sp,
173 std::move(api_lock), std::move(stop_locker));
174}
175
176std::unique_lock<std::recursive_mutex> StoppedExecutionContext::AllowResume() {
177 Clear();
179 return std::move(m_api_lock);
180}
181
184 if (exe_scope_ptr)
185 exe_scope_ptr->CalculateExecutionContext(*this);
186}
187
191
193 m_target_sp.reset();
194 m_process_sp.reset();
195 m_thread_sp.reset();
196 m_frame_sp.reset();
197}
198
200
202 if (m_target_sp && m_target_sp->GetArchitecture().IsValid())
203 return m_target_sp->GetArchitecture().GetAddressByteSize();
204 if (m_process_sp)
205 return m_process_sp->GetAddressByteSize();
206 return sizeof(void *);
207}
208
210 if (m_target_sp && m_target_sp->GetArchitecture().IsValid())
211 return m_target_sp->GetArchitecture().GetByteOrder();
212 if (m_process_sp)
213 return m_process_sp->GetByteOrder();
215}
216
218 if (m_frame_sp)
219 return m_frame_sp->GetRegisterContext().get();
220 else if (m_thread_sp)
221 return m_thread_sp->GetRegisterContext().get();
222 return nullptr;
223}
224
226 if (m_target_sp)
227 return m_target_sp.get();
228 if (m_process_sp)
229 return &m_process_sp->GetTarget();
230 return nullptr;
231}
232
234 if (m_process_sp)
235 return m_process_sp.get();
236 if (m_target_sp)
237 return m_target_sp->GetProcessSP().get();
238 return nullptr;
239}
240
242 if (m_frame_sp)
243 return m_frame_sp.get();
244 if (m_thread_sp)
245 return m_thread_sp.get();
246 if (m_process_sp)
247 return m_process_sp.get();
248 return m_target_sp.get();
249}
250
252 assert(m_target_sp);
253 return *m_target_sp;
254}
255
257 assert(m_process_sp);
258 return *m_process_sp;
259}
260
262 assert(m_thread_sp);
263 return *m_thread_sp;
264}
265
267 assert(m_frame_sp);
268 return *m_frame_sp;
269}
270
272 m_target_sp = target_sp;
273}
274
276 m_process_sp = process_sp;
277}
278
280 m_thread_sp = thread_sp;
281}
282
284 m_frame_sp = frame_sp;
285}
286
288 if (target)
289 m_target_sp = target->shared_from_this();
290 else
291 m_target_sp.reset();
292}
293
295 if (process)
296 m_process_sp = process->shared_from_this();
297 else
298 m_process_sp.reset();
299}
300
302 if (thread)
303 m_thread_sp = thread->shared_from_this();
304 else
305 m_thread_sp.reset();
306}
307
309 if (frame)
310 m_frame_sp = frame->shared_from_this();
311 else
312 m_frame_sp.reset();
313}
314
316 bool get_process) {
317 m_target_sp = target_sp;
318 if (get_process && target_sp)
319 m_process_sp = target_sp->GetProcessSP();
320 else
321 m_process_sp.reset();
322 m_thread_sp.reset();
323 m_frame_sp.reset();
324}
325
327 m_process_sp = process_sp;
328 if (process_sp)
329 m_target_sp = process_sp->GetTarget().shared_from_this();
330 else
331 m_target_sp.reset();
332 m_thread_sp.reset();
333 m_frame_sp.reset();
334}
335
336void ExecutionContext::SetContext(const lldb::ThreadSP &thread_sp) {
337 m_frame_sp.reset();
338 m_thread_sp = thread_sp;
339 if (thread_sp) {
340 m_process_sp = thread_sp->GetProcess();
341 if (m_process_sp)
342 m_target_sp = m_process_sp->GetTarget().shared_from_this();
343 else
344 m_target_sp.reset();
345 } else {
346 m_target_sp.reset();
347 m_process_sp.reset();
348 }
349}
350
352 m_frame_sp = frame_sp;
353 if (frame_sp) {
354 m_thread_sp = frame_sp->CalculateThread();
355 if (m_thread_sp) {
356 m_process_sp = m_thread_sp->GetProcess();
357 if (m_process_sp)
358 m_target_sp = m_process_sp->GetTarget().shared_from_this();
359 else
360 m_target_sp.reset();
361 } else {
362 m_target_sp.reset();
363 m_process_sp.reset();
364 }
365 } else {
366 m_target_sp.reset();
367 m_process_sp.reset();
368 m_thread_sp.reset();
369 }
370}
371
373 if (this != &rhs) {
378 }
379 return *this;
380}
381
383 // Check that the frame shared pointers match, or both are valid and their
384 // stack IDs match since sometimes we get new objects that represent the same
385 // frame within a thread.
386 if ((m_frame_sp == rhs.m_frame_sp) ||
387 (m_frame_sp && rhs.m_frame_sp &&
388 m_frame_sp->GetStackID() == rhs.m_frame_sp->GetStackID())) {
389 // Check that the thread shared pointers match, or both are valid and their
390 // thread IDs match since sometimes we get new objects that represent the
391 // same thread within a process.
392 if ((m_thread_sp == rhs.m_thread_sp) ||
393 (m_thread_sp && rhs.m_thread_sp &&
394 m_thread_sp->GetID() == rhs.m_thread_sp->GetID())) {
395 // Processes and targets don't change much
396 return m_process_sp == rhs.m_process_sp && m_target_sp == rhs.m_target_sp;
397 }
398 }
399 return false;
400}
401
403 return !(*this == rhs);
404}
405
407 return ((bool)m_target_sp && m_target_sp->IsValid());
408}
409
411 return (HasTargetScope() && ((bool)m_process_sp && m_process_sp->IsValid()));
412}
413
415 return (HasProcessScope() && ((bool)m_thread_sp && m_thread_sp->IsValid()));
416}
417
419 return HasThreadScope() && m_frame_sp;
420}
421
424
427 if (exe_ctx)
428 *this = *exe_ctx;
429}
430
435
438 SetTargetPtr(target, adopt_selected);
439}
440
443 SetProcessPtr(process, adopt_selected);
444}
445
448 SetThreadPtr(thread, adopt_selected);
449}
450
452
453 = default;
454
456operator=(const ExecutionContextRef &rhs) {
457 if (this != &rhs) {
461 m_tid = rhs.m_tid;
463 }
464 return *this;
465}
466
468operator=(const ExecutionContext &exe_ctx) {
469 m_target_wp = exe_ctx.GetTargetSP();
470 m_process_wp = exe_ctx.GetProcessSP();
471 lldb::ThreadSP thread_sp(exe_ctx.GetThreadSP());
472 m_thread_wp = thread_sp;
473 if (thread_sp)
474 m_tid = thread_sp->GetID();
475 else
477 lldb::StackFrameSP frame_sp(exe_ctx.GetFrameSP());
478
479 if (frame_sp && thread_sp) {
480 lldb::frame_list_id_t frame_list_id =
481 frame_sp->GetContainingStackFrameListIdentifier();
482 auto frame_list_descriptor_or_err =
483 thread_sp->GetScriptedFrameProviderDescriptorForID(frame_list_id);
484 if (frame_list_descriptor_or_err) {
485 m_stack_id = frame_sp->GetStackID();
486 m_frame_list_id = {*frame_list_descriptor_or_err, frame_list_id};
487 } else {
489 frame_list_descriptor_or_err.takeError(),
490 "Failed to fetch scripted frame provider descriptor: {0}");
491 m_stack_id.Clear();
492 m_frame_list_id.reset();
493 }
494 } else {
495 m_stack_id.Clear();
496 m_frame_list_id.reset();
497 }
498 return *this;
499}
500
502 m_target_wp.reset();
503 m_process_wp.reset();
504 ClearThread();
505 ClearFrame();
506}
507
509
511 m_target_wp = target_sp;
512}
513
515 if (process_sp) {
516 m_process_wp = process_sp;
517 SetTargetSP(process_sp->GetTarget().shared_from_this());
518 } else {
519 m_process_wp.reset();
520 m_target_wp.reset();
521 }
522}
523
525 if (thread_sp) {
526 m_thread_wp = thread_sp;
527 m_tid = thread_sp->GetID();
528 SetProcessSP(thread_sp->GetProcess());
529 } else {
530 ClearThread();
531 m_process_wp.reset();
532 m_target_wp.reset();
533 }
534}
535
537 if (!frame_sp) {
538 Clear();
539 return;
540 }
541
542 lldb::ThreadSP thread_sp = frame_sp->GetThread();
543 lldb::frame_list_id_t frame_list_id =
544 frame_sp->GetContainingStackFrameListIdentifier();
545 auto frame_list_descriptor_or_err =
546 thread_sp->GetScriptedFrameProviderDescriptorForID(frame_list_id);
547
548 if (frame_list_descriptor_or_err) {
549 m_stack_id = frame_sp->GetStackID();
550 m_frame_list_id = {*frame_list_descriptor_or_err, frame_list_id};
551 SetThreadSP(thread_sp);
552 } else {
554 frame_list_descriptor_or_err.takeError(),
555 "Failed to fetch scripted frame provider descriptor: {0}");
556 ClearFrame();
557 ClearThread();
558 m_process_wp.reset();
559 m_target_wp.reset();
560 }
561}
562
563void ExecutionContextRef::SetTargetPtr(Target *target, bool adopt_selected) {
564 Clear();
565 if (target) {
566 lldb::TargetSP target_sp = target->shared_from_this();
567 SetTargetSP(target_sp);
568 if (adopt_selected) {
569 if (lldb::ProcessSP process_sp = target_sp->GetProcessSP())
570 SetProcessPtr(process_sp.get(), adopt_selected);
571 }
572 }
573}
574
575void ExecutionContextRef::SetProcessPtr(Process *process, bool adopt_selected) {
576 if (process) {
577 lldb::ProcessSP process_sp = process->shared_from_this();
578 SetProcessSP(process_sp);
579 if (adopt_selected) {
580 // Only fill in the thread if our process is stopped.
581 // Don't just check the state, since we might be in the middle of
582 // resuming.
583 Process::StopLocker stop_locker;
584 if (stop_locker.TryLock(&process_sp->GetRunLock()) &&
585 StateIsStoppedState(process_sp->GetState(), true)) {
586 lldb::ThreadSP thread_sp(
587 process_sp->GetThreadList().GetSelectedThread());
588 if (!thread_sp)
589 thread_sp = process_sp->GetThreadList().GetThreadAtIndex(0);
590 if (thread_sp) {
591 SetThreadSP(thread_sp);
592 lldb::StackFrameSP frame_sp =
593 thread_sp->GetSelectedFrame(DoNoSelectMostRelevantFrame);
594 if (!frame_sp)
595 frame_sp = thread_sp->GetStackFrameAtIndex(0);
596 if (frame_sp)
597 SetFrameSP(frame_sp);
598 }
599 }
600 }
601 } else {
602 m_process_wp.reset();
603 m_target_wp.reset();
604 }
605}
606
607void ExecutionContextRef::SetThreadPtr(Thread *thread, bool adopt_selected) {
608 if (thread) {
609 lldb::ThreadSP thread_sp = thread->shared_from_this();
610 SetThreadSP(thread_sp);
611 if (adopt_selected) {
612 // Only fill in the frame if our process is stopped.
613 // Don't just check the state, since we might be in the middle of
614 // resuming.
615 Process::StopLocker stop_locker;
616 if (stop_locker.TryLock(&thread->GetProcess()->GetRunLock()) &&
617 StateIsStoppedState(thread->GetProcess()->GetState(), true)) {
618 lldb::StackFrameSP frame_sp =
619 thread_sp->GetSelectedFrame(DoNoSelectMostRelevantFrame);
620 if (!frame_sp)
621 frame_sp = thread_sp->GetStackFrameAtIndex(0);
622 if (frame_sp)
623 SetFrameSP(frame_sp);
624 }
625 }
626 } else {
627 ClearThread();
628 m_process_wp.reset();
629 m_target_wp.reset();
630 }
631}
632
634 if (frame)
635 SetFrameSP(frame->shared_from_this());
636 else
637 Clear();
638}
639
641 lldb::TargetSP target_sp(m_target_wp.lock());
642 if (target_sp && !target_sp->IsValid())
643 target_sp.reset();
644 return target_sp;
645}
646
648 lldb::ProcessSP process_sp(m_process_wp.lock());
649 if (process_sp && !process_sp->IsValid())
650 process_sp.reset();
651 return process_sp;
652}
653
655 lldb::ThreadSP thread_sp(m_thread_wp.lock());
656
658 // We check if the thread has been destroyed in cases where clients might
659 // still have shared pointer to a thread, but the thread is not valid
660 // anymore (not part of the process)
661 if (!thread_sp || !thread_sp->IsValid()) {
662 lldb::ProcessSP process_sp(GetProcessSP());
663 if (process_sp && process_sp->IsValid()) {
664 thread_sp = process_sp->GetThreadList().FindThreadByID(m_tid);
665 m_thread_wp = thread_sp;
666 }
667 }
668 }
669
670 // Check that we aren't about to return an invalid thread sp. We might
671 // return a nullptr thread_sp, but don't return an invalid one.
672
673 if (thread_sp && !thread_sp->IsValid())
674 thread_sp.reset();
675
676 return thread_sp;
677}
678
680 lldb::ThreadSP thread_sp(GetThreadSP());
681 if (!thread_sp || !m_stack_id.IsValid())
682 return lldb::StackFrameSP();
683
684 // Try the remembered frame list first to avoid circular dependencies
685 // during frame provider initialization.
686 if (m_frame_list_id) {
687 if (auto frame_list_sp =
688 thread_sp->GetFrameListByIdentifier(m_frame_list_id->second)) {
689 if (auto frame_sp = frame_list_sp->GetFrameWithStackID(m_stack_id))
690 return frame_sp;
691 }
692 }
693
694 // Fallback: ask the thread, which might re-trigger the frame provider
695 // initialization.
696 return thread_sp->GetFrameWithStackID(m_stack_id);
697}
698
700ExecutionContextRef::Lock(bool thread_and_frame_only_if_stopped) const {
701 return ExecutionContext(this, thread_and_frame_only_if_stopped);
702}
#define LLDB_LOG_ERROR(log, error,...)
Definition Log.h:392
Execution context objects refer to objects in the execution of the program that is being debugged.
StackID m_stack_id
The stack ID that this object refers to in case the backing object changes.
ExecutionContext Lock(bool thread_and_frame_only_if_stopped) const
Create an ExecutionContext object from this object.
void SetThreadSP(const lldb::ThreadSP &thread_sp)
Set accessor that creates a weak reference to the thread referenced in thread_sp.
void Clear()
Clear the object's state.
lldb::StackFrameSP GetFrameSP() const
Get accessor that creates a strong reference from the weak frame reference contained in this object.
lldb::ProcessWP m_process_wp
A weak reference to a process.
lldb::ThreadSP GetThreadSP() const
Get accessor that creates a strong reference from the weak thread reference contained in this object.
void SetFrameSP(const lldb::StackFrameSP &frame_sp)
Set accessor that creates a weak reference to the frame referenced in frame_sp.
lldb::tid_t m_tid
The thread ID that this object refers to in case the backing object changes.
lldb::TargetSP GetTargetSP() const
Get accessor that creates a strong reference from the weak target reference contained in this object.
void SetTargetPtr(Target *target, bool adopt_selected)
lldb::ProcessSP GetProcessSP() const
Get accessor that creates a strong reference from the weak process reference contained in this object...
void SetThreadPtr(Thread *thread, bool adopt_selected=false)
ExecutionContextRef & operator=(const ExecutionContextRef &rhs)
Assignment operator.
ExecutionContextRef()
Default Constructor.
std::optional< std::pair< ScriptedFrameProviderDescriptor, lldb::frame_list_id_t > > m_frame_list_id
A map of identifiers to scripted frame providers used in this thread.
void SetTargetSP(const lldb::TargetSP &target_sp)
Set accessor that creates a weak reference to the target referenced in target_sp.
void SetProcessPtr(Process *process, bool adopt_selected=false)
lldb::TargetWP m_target_wp
A weak reference to a target.
void SetProcessSP(const lldb::ProcessSP &process_sp)
Set accessor that creates a weak reference to the process referenced in process_sp.
lldb::ThreadWP m_thread_wp
A weak reference to a thread.
"lldb/Target/ExecutionContextScope.h" Inherit from this if your object can reconstruct its execution ...
virtual void CalculateExecutionContext(ExecutionContext &exe_ctx)=0
Reconstruct the object's execution context into sc.
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
void SetFrameSP(const lldb::StackFrameSP &frame_sp)
Set accessor to set only the frame shared pointer.
bool HasThreadScope() const
Returns true the ExecutionContext object contains a valid target, process, and thread.
void SetProcessPtr(Process *process)
Set accessor to set only the process shared pointer from a process pointer.
bool HasProcessScope() const
Returns true the ExecutionContext object contains a valid target and process.
ExecutionContextScope * GetBestExecutionContextScope() const
const lldb::TargetSP & GetTargetSP() const
Get accessor to get the target shared pointer.
void Clear()
Clear the object's state.
ExecutionContext()
Default Constructor.
const lldb::ProcessSP & GetProcessSP() const
Get accessor to get the process shared pointer.
void SetProcessSP(const lldb::ProcessSP &process_sp)
Set accessor to set only the process shared pointer.
lldb::StackFrameSP m_frame_sp
The stack frame in thread.
bool operator==(const ExecutionContext &rhs) const
void SetThreadPtr(Thread *thread)
Set accessor to set only the thread shared pointer from a thread pointer.
lldb::ByteOrder GetByteOrder() const
void SetTargetPtr(Target *target)
Set accessor to set only the target shared pointer from a target pointer.
lldb::TargetSP m_target_sp
The target that owns the process/thread/frame.
const lldb::StackFrameSP & GetFrameSP() const
Get accessor to get the frame shared pointer.
Process & GetProcessRef() const
Returns a reference to the process object.
void SetContext(const lldb::TargetSP &target_sp, bool get_process)
void SetTargetSP(const lldb::TargetSP &target_sp)
Set accessor to set only the target shared pointer.
Target * GetTargetPtr() const
Returns a pointer to the target object.
const lldb::ThreadSP & GetThreadSP() const
Get accessor to get the thread shared pointer.
void SetThreadSP(const lldb::ThreadSP &thread_sp)
Set accessor to set only the thread shared pointer.
bool HasTargetScope() const
Returns true the ExecutionContext object contains a valid target.
StackFrame & GetFrameRef() const
Returns a reference to the thread object.
bool HasFrameScope() const
Returns true the ExecutionContext object contains a valid target, process, thread and frame.
lldb::ThreadSP m_thread_sp
The thread that owns the frame.
lldb::ProcessSP m_process_sp
The process that owns the thread/frame.
bool operator!=(const ExecutionContext &rhs) const
Target & GetTargetRef() const
Returns a reference to the target object.
void SetFramePtr(StackFrame *frame)
Set accessor to set only the frame shared pointer from a frame pointer.
ExecutionContext & operator=(const ExecutionContext &rhs)
Process * GetProcessPtr() const
Returns a pointer to the process object.
Thread & GetThreadRef() const
Returns a reference to the thread object.
RegisterContext * GetRegisterContext() const
A plug-in interface definition class for debugging a process.
Definition Process.h:354
ProcessRunLock::ProcessRunLocker StopLocker
Definition Process.h:393
Target & GetTarget()
Get the target object pointer for this module.
Definition Process.h:1250
This base class provides an interface to stack frames.
Definition StackFrame.h:44
const lldb::ProcessSP & GetProcessSP() const
Definition Target.cpp:313
#define LLDB_INVALID_THREAD_ID
@ DoNoSelectMostRelevantFrame
lldb::ByteOrder InlHostByteOrder()
Definition Endian.h:25
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:332
bool StateIsStoppedState(lldb::StateType state, bool must_exist)
Check if a state represents a state where the process or thread is stopped.
Definition State.cpp:89
llvm::Expected< StoppedExecutionContext > GetStoppedExecutionContext(const ExecutionContextRef *exe_ctx_ref_ptr)
std::weak_ptr< lldb_private::StackFrame > StackFrameWP
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::Process > ProcessSP
ByteOrder
Byte ordering definitions.
std::weak_ptr< lldb_private::Process > ProcessWP
std::weak_ptr< lldb_private::Target > TargetWP
std::shared_ptr< lldb_private::Target > TargetSP
std::weak_ptr< lldb_private::Thread > ThreadWP
std::shared_ptr< lldb_private::ExecutionContextRef > ExecutionContextRefSP
uint32_t frame_list_id_t
Definition lldb-types.h:86
A wrapper class representing an execution context with non-null Target and Process pointers,...
ProcessRunLock::ProcessRunLocker m_stop_locker
std::unique_lock< std::recursive_mutex > m_api_lock
std::unique_lock< std::recursive_mutex > AllowResume()
Clears this context, unlocking the ProcessRunLock and returning the locked API lock,...