27 if (valobj_sp->GetNumChildrenIgnoringErrors() != 1)
32 if (!ptr_sp->GetCompilerType().IsPointerType())
36 lldb::addr_t frame_ptr_addr = ptr_sp->GetPointerValue(&addr_type);
39 lldbassert(addr_type == AddressType::eAddressTypeLoad);
40 if (addr_type != AddressType::eAddressTypeLoad)
43 return frame_ptr_addr;
49 auto ptr_size = process_sp->GetAddressByteSize();
52 auto destroy_func_ptr_addr = frame_ptr_addr + ptr_size;
54 process_sp->ReadPointerFromMemory(destroy_func_ptr_addr,
error);
59 if (!target_sp->ResolveLoadAddress(destroy_func_addr, destroy_func_address))
71 auto promise_var = variable_list->FindVariable(
ConstString(
"__promise"));
74 if (!promise_var->IsArtificial())
77 Type *promise_type = promise_var->GetType();
90 if (frame_ptr_addr == 0) {
93 stream.
Printf(
"coro frame = 0x%" PRIx64, frame_ptr_addr);
111 if (!m_resume_ptr_sp || !m_destroy_ptr_sp)
114 return m_promise_ptr_sp ? 3 : 2;
121 return m_resume_ptr_sp;
123 return m_destroy_ptr_sp;
125 return m_promise_ptr_sp;
132 m_resume_ptr_sp.reset();
133 m_destroy_ptr_sp.reset();
134 m_promise_ptr_sp.reset();
144 auto ts = valobj_sp->GetCompilerType().GetTypeSystem();
151 auto &exe_ctx = m_backend.GetExecutionContextRef();
153 auto ptr_size = process_sp->GetAddressByteSize();
155 CompilerType coro_func_type = ast_ctx->CreateFunctionType(
156 void_type, &void_type, 1,
159 m_resume_ptr_sp = CreateValueObjectFromAddress(
160 "resume", frame_ptr_addr + 0 * ptr_size, exe_ctx, coro_func_ptr_type);
162 m_destroy_ptr_sp = CreateValueObjectFromAddress(
163 "destroy", frame_ptr_addr + 1 * ptr_size, exe_ctx, coro_func_ptr_type);
168 valobj_sp->GetCompilerType().GetTypeTemplateArgument(0));
177 promise_type = inferred_type;
193 "promise", frame_ptr_addr + 2 * ptr_size, exe_ctx, promise_type);
197 m_promise_ptr_sp = promisePtr->Clone(
ConstString(
"promise"));
static llvm::raw_ostream & error(Stream &strm)
static Function * ExtractDestroyFunction(lldb::TargetSP target_sp, lldb::addr_t frame_ptr_addr)
static lldb::addr_t GetCoroFramePtrFromHandle(ValueObjectSP valobj_sp)
static CompilerType InferPromiseType(Function &destroy_func)
A section + offset based address class.
Function * CalculateSymbolContextFunction() const
A class that describes a single lexical block.
lldb::VariableListSP GetBlockVariableList(bool can_create)
Get the variable list for this block only.
Generic representation of a type in a programming language.
CompilerType GetPointerType() const
Return a new CompilerType that is a pointer to this type.
A uniqued constant string class.
A class that describes a function.
Block & GetBlock(bool can_create)
Get accessor for the block list.
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
A TypeSystem implementation based on Clang.
CompilerType GetForwardCompilerType()
virtual lldb::ValueObjectSP GetNonSyntheticValue()
#define LLDB_INVALID_ADDRESS
A class that represents a running process on the host machine.
ChildCacheState
Specifies if children need to be re-computed after a call to SyntheticChildrenFrontEnd::Update.
@ eRefetch
Children need to be recomputed dynamically.
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Target > TargetSP