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_mutex = target_sp->GetAPIMutex();
149 std::unique_lock<TargetAPIMutex> api_locker(api_mutex);
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_mutex), std::move(api_locker),
174 std::move(stop_locker));
175}
176
183
186 if (exe_scope_ptr)
187 exe_scope_ptr->CalculateExecutionContext(*this);
188}
189
193
195 m_target_sp.reset();
196 m_process_sp.reset();
197 m_thread_sp.reset();
198 m_frame_sp.reset();
199}
200
202
204 if (m_target_sp && m_target_sp->GetArchitecture().IsValid())
205 return m_target_sp->GetArchitecture().GetAddressByteSize();
206 if (m_process_sp)
207 return m_process_sp->GetAddressByteSize();
208 return sizeof(void *);
209}
210
212 if (m_target_sp && m_target_sp->GetArchitecture().IsValid())
213 return m_target_sp->GetArchitecture().GetByteOrder();
214 if (m_process_sp)
215 return m_process_sp->GetByteOrder();
217}
218
220 if (m_frame_sp)
221 return m_frame_sp->GetRegisterContext().get();
222 else if (m_thread_sp)
223 return m_thread_sp->GetRegisterContext().get();
224 return nullptr;
225}
226
228 if (m_target_sp)
229 return m_target_sp.get();
230 if (m_process_sp)
231 return &m_process_sp->GetTarget();
232 return nullptr;
233}
234
236 if (m_process_sp)
237 return m_process_sp.get();
238 if (m_target_sp)
239 return m_target_sp->GetProcessSP().get();
240 return nullptr;
241}
242
244 if (m_frame_sp)
245 return m_frame_sp.get();
246 if (m_thread_sp)
247 return m_thread_sp.get();
248 if (m_process_sp)
249 return m_process_sp.get();
250 return m_target_sp.get();
251}
252
254 assert(m_target_sp);
255 return *m_target_sp;
256}
257
259 assert(m_process_sp);
260 return *m_process_sp;
261}
262
264 assert(m_thread_sp);
265 return *m_thread_sp;
266}
267
269 assert(m_frame_sp);
270 return *m_frame_sp;
271}
272
274 m_target_sp = target_sp;
275}
276
278 m_process_sp = process_sp;
279}
280
282 m_thread_sp = thread_sp;
283}
284
286 m_frame_sp = frame_sp;
287}
288
290 if (target)
291 m_target_sp = target->shared_from_this();
292 else
293 m_target_sp.reset();
294}
295
297 if (process)
298 m_process_sp = process->shared_from_this();
299 else
300 m_process_sp.reset();
301}
302
304 if (thread)
305 m_thread_sp = thread->shared_from_this();
306 else
307 m_thread_sp.reset();
308}
309
311 if (frame)
312 m_frame_sp = frame->shared_from_this();
313 else
314 m_frame_sp.reset();
315}
316
318 bool get_process) {
319 m_target_sp = target_sp;
320 if (get_process && target_sp)
321 m_process_sp = target_sp->GetProcessSP();
322 else
323 m_process_sp.reset();
324 m_thread_sp.reset();
325 m_frame_sp.reset();
326}
327
329 m_process_sp = process_sp;
330 if (process_sp)
331 m_target_sp = process_sp->GetTarget().shared_from_this();
332 else
333 m_target_sp.reset();
334 m_thread_sp.reset();
335 m_frame_sp.reset();
336}
337
338void ExecutionContext::SetContext(const lldb::ThreadSP &thread_sp) {
339 m_frame_sp.reset();
340 m_thread_sp = thread_sp;
341 if (thread_sp) {
342 m_process_sp = thread_sp->GetProcess();
343 if (m_process_sp)
344 m_target_sp = m_process_sp->GetTarget().shared_from_this();
345 else
346 m_target_sp.reset();
347 } else {
348 m_target_sp.reset();
349 m_process_sp.reset();
350 }
351}
352
354 m_frame_sp = frame_sp;
355 if (frame_sp) {
356 m_thread_sp = frame_sp->CalculateThread();
357 if (m_thread_sp) {
358 m_process_sp = m_thread_sp->GetProcess();
359 if (m_process_sp)
360 m_target_sp = m_process_sp->GetTarget().shared_from_this();
361 else
362 m_target_sp.reset();
363 } else {
364 m_target_sp.reset();
365 m_process_sp.reset();
366 }
367 } else {
368 m_target_sp.reset();
369 m_process_sp.reset();
370 m_thread_sp.reset();
371 }
372}
373
375 if (this != &rhs) {
380 }
381 return *this;
382}
383
385 // Check that the frame shared pointers match, or both are valid and their
386 // stack IDs match since sometimes we get new objects that represent the same
387 // frame within a thread.
388 if ((m_frame_sp == rhs.m_frame_sp) ||
389 (m_frame_sp && rhs.m_frame_sp &&
390 m_frame_sp->GetStackID() == rhs.m_frame_sp->GetStackID())) {
391 // Check that the thread shared pointers match, or both are valid and their
392 // thread IDs match since sometimes we get new objects that represent the
393 // same thread within a process.
394 if ((m_thread_sp == rhs.m_thread_sp) ||
395 (m_thread_sp && rhs.m_thread_sp &&
396 m_thread_sp->GetID() == rhs.m_thread_sp->GetID())) {
397 // Processes and targets don't change much
398 return m_process_sp == rhs.m_process_sp && m_target_sp == rhs.m_target_sp;
399 }
400 }
401 return false;
402}
403
405 return !(*this == rhs);
406}
407
409 return ((bool)m_target_sp && m_target_sp->IsValid());
410}
411
413 return (HasTargetScope() && ((bool)m_process_sp && m_process_sp->IsValid()));
414}
415
417 return (HasProcessScope() && ((bool)m_thread_sp && m_thread_sp->IsValid()));
418}
419
421 return HasThreadScope() && m_frame_sp;
422}
423
426
429 if (exe_ctx)
430 *this = *exe_ctx;
431}
432
437
440 SetTargetPtr(target, adopt_selected);
441}
442
445 SetProcessPtr(process, adopt_selected);
446}
447
450 SetThreadPtr(thread, adopt_selected);
451}
452
454
455 = default;
456
458operator=(const ExecutionContextRef &rhs) {
459 if (this != &rhs) {
463 m_tid = rhs.m_tid;
465 }
466 return *this;
467}
468
470operator=(const ExecutionContext &exe_ctx) {
471 m_target_wp = exe_ctx.GetTargetSP();
472 m_process_wp = exe_ctx.GetProcessSP();
473 lldb::ThreadSP thread_sp(exe_ctx.GetThreadSP());
474 m_thread_wp = thread_sp;
475 if (thread_sp)
476 m_tid = thread_sp->GetID();
477 else
479 lldb::StackFrameSP frame_sp(exe_ctx.GetFrameSP());
480
481 if (frame_sp && thread_sp) {
482 lldb::frame_list_id_t frame_list_id =
483 frame_sp->GetContainingStackFrameListIdentifier();
484 auto frame_list_descriptor_or_err =
485 thread_sp->GetScriptedFrameProviderDescriptorForID(frame_list_id);
486 if (frame_list_descriptor_or_err) {
487 m_stack_id = frame_sp->GetStackID();
488 m_frame_list_id = {*frame_list_descriptor_or_err, frame_list_id};
489 } else {
491 frame_list_descriptor_or_err.takeError(),
492 "Failed to fetch scripted frame provider descriptor: {0}");
493 m_stack_id.Clear();
494 m_frame_list_id.reset();
495 }
496 } else {
497 m_stack_id.Clear();
498 m_frame_list_id.reset();
499 }
500 return *this;
501}
502
504 m_target_wp.reset();
505 m_process_wp.reset();
506 ClearThread();
507 ClearFrame();
508}
509
511
513 m_target_wp = target_sp;
514}
515
517 if (process_sp) {
518 m_process_wp = process_sp;
519 SetTargetSP(process_sp->GetTarget().shared_from_this());
520 } else {
521 m_process_wp.reset();
522 m_target_wp.reset();
523 }
524}
525
527 if (thread_sp) {
528 m_thread_wp = thread_sp;
529 m_tid = thread_sp->GetID();
530 SetProcessSP(thread_sp->GetProcess());
531 } else {
532 ClearThread();
533 m_process_wp.reset();
534 m_target_wp.reset();
535 }
536}
537
539 if (!frame_sp) {
540 Clear();
541 return;
542 }
543
544 lldb::ThreadSP thread_sp = frame_sp->GetThread();
545 lldb::frame_list_id_t frame_list_id =
546 frame_sp->GetContainingStackFrameListIdentifier();
547 auto frame_list_descriptor_or_err =
548 thread_sp->GetScriptedFrameProviderDescriptorForID(frame_list_id);
549
550 if (frame_list_descriptor_or_err) {
551 m_stack_id = frame_sp->GetStackID();
552 m_frame_list_id = {*frame_list_descriptor_or_err, frame_list_id};
553 SetThreadSP(thread_sp);
554 } else {
556 frame_list_descriptor_or_err.takeError(),
557 "Failed to fetch scripted frame provider descriptor: {0}");
558 ClearFrame();
559 ClearThread();
560 m_process_wp.reset();
561 m_target_wp.reset();
562 }
563}
564
565void ExecutionContextRef::SetTargetPtr(Target *target, bool adopt_selected) {
566 Clear();
567 if (target) {
568 lldb::TargetSP target_sp = target->shared_from_this();
569 SetTargetSP(target_sp);
570 if (adopt_selected) {
571 if (lldb::ProcessSP process_sp = target_sp->GetProcessSP())
572 SetProcessPtr(process_sp.get(), adopt_selected);
573 }
574 }
575}
576
577void ExecutionContextRef::SetProcessPtr(Process *process, bool adopt_selected) {
578 if (process) {
579 lldb::ProcessSP process_sp = process->shared_from_this();
580 SetProcessSP(process_sp);
581 if (adopt_selected) {
582 // Only fill in the thread if our process is stopped.
583 // Don't just check the state, since we might be in the middle of
584 // resuming.
585 Process::StopLocker stop_locker;
586 if (stop_locker.TryLock(&process_sp->GetRunLock()) &&
587 StateIsStoppedState(process_sp->GetState(), true)) {
588 lldb::ThreadSP thread_sp(
589 process_sp->GetThreadList().GetSelectedThread());
590 if (!thread_sp)
591 thread_sp = process_sp->GetThreadList().GetThreadAtIndex(0);
592 if (thread_sp) {
593 SetThreadSP(thread_sp);
594 lldb::StackFrameSP frame_sp =
595 thread_sp->GetSelectedFrame(DoNoSelectMostRelevantFrame);
596 if (!frame_sp)
597 frame_sp = thread_sp->GetStackFrameAtIndex(0);
598 if (frame_sp)
599 SetFrameSP(frame_sp);
600 }
601 }
602 }
603 } else {
604 m_process_wp.reset();
605 m_target_wp.reset();
606 }
607}
608
609void ExecutionContextRef::SetThreadPtr(Thread *thread, bool adopt_selected) {
610 if (thread) {
611 lldb::ThreadSP thread_sp = thread->shared_from_this();
612 SetThreadSP(thread_sp);
613 if (adopt_selected) {
614 // Only fill in the frame if our process is stopped.
615 // Don't just check the state, since we might be in the middle of
616 // resuming.
617 Process::StopLocker stop_locker;
618 if (stop_locker.TryLock(&thread->GetProcess()->GetRunLock()) &&
619 StateIsStoppedState(thread->GetProcess()->GetState(), true)) {
620 lldb::StackFrameSP frame_sp =
621 thread_sp->GetSelectedFrame(DoNoSelectMostRelevantFrame);
622 if (!frame_sp)
623 frame_sp = thread_sp->GetStackFrameAtIndex(0);
624 if (frame_sp)
625 SetFrameSP(frame_sp);
626 }
627 }
628 } else {
629 ClearThread();
630 m_process_wp.reset();
631 m_target_wp.reset();
632 }
633}
634
636 if (frame)
637 SetFrameSP(frame->shared_from_this());
638 else
639 Clear();
640}
641
643 lldb::TargetSP target_sp(m_target_wp.lock());
644 if (target_sp && !target_sp->IsValid())
645 target_sp.reset();
646 return target_sp;
647}
648
650 lldb::ProcessSP process_sp(m_process_wp.lock());
651 if (process_sp && !process_sp->IsValid())
652 process_sp.reset();
653 return process_sp;
654}
655
657 lldb::ThreadSP thread_sp(m_thread_wp.lock());
658
660 // We check if the thread has been destroyed in cases where clients might
661 // still have shared pointer to a thread, but the thread is not valid
662 // anymore (not part of the process)
663 if (!thread_sp || !thread_sp->IsValid()) {
664 lldb::ProcessSP process_sp(GetProcessSP());
665 if (process_sp && process_sp->IsValid()) {
666 thread_sp = process_sp->GetThreadList().FindThreadByID(m_tid);
667 m_thread_wp = thread_sp;
668 }
669 }
670 }
671
672 // Check that we aren't about to return an invalid thread sp. We might
673 // return a nullptr thread_sp, but don't return an invalid one.
674
675 if (thread_sp && !thread_sp->IsValid())
676 thread_sp.reset();
677
678 return thread_sp;
679}
680
682 lldb::ThreadSP thread_sp(GetThreadSP());
683 if (!thread_sp || !m_stack_id.IsValid())
684 return lldb::StackFrameSP();
685
686 // Try the remembered frame list first to avoid circular dependencies
687 // during frame provider initialization.
688 if (m_frame_list_id) {
689 if (auto frame_list_sp =
690 thread_sp->GetFrameListByIdentifier(m_frame_list_id->second)) {
691 if (auto frame_sp = frame_list_sp->GetFrameWithStackID(m_stack_id))
692 return frame_sp;
693 }
694 }
695
696 // Fallback: ask the thread, which might re-trigger the frame provider
697 // initialization.
698 return thread_sp->GetFrameWithStackID(m_stack_id);
699}
700
702ExecutionContextRef::Lock(bool thread_and_frame_only_if_stopped) const {
703 return ExecutionContext(this, thread_and_frame_only_if_stopped);
704}
#define LLDB_LOG_ERROR(log, error,...)
Definition Log.h:405
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
RAII helper around the read-lock side of ProcessRunLock.
bool TryLock(ProcessRunLock *lock)
Try to acquire the read lock.
A plug-in interface definition class for debugging a process.
Definition Process.h:360
ProcessRunLock::ProcessRunLocker StopLocker
Definition Process.h:400
Target & GetTarget()
Get the target object pointer for this module.
Definition Process.h:1259
This base class provides an interface to stack frames.
Definition StackFrame.h:44
A Lockable handle over a Target's API mutex, returned by Target::GetAPIMutex() and backing the public...
const lldb::ProcessSP & GetProcessSP() const
Definition Target.cpp:329
#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:338
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:87
A wrapper class representing an execution context with non-null Target and Process pointers,...
std::unique_lock< TargetAPIMutex > m_api_locker
ProcessRunLock::ProcessRunLocker m_stop_locker
TargetAPIMutex AllowResume()
Clears this context, unlocking the ProcessRunLock and returning the locked API lock,...