labath added inline comments.

================
Comment at: lldb/source/Plugins/Language/CPlusPlus/Coroutines.cpp:246-248
+  DataExtractor data(&promise_addr, sizeof(promise_addr),
+                     process_sp->GetByteOrder(),
+                     process_sp->GetAddressByteSize());
----------------
Have you checked there won't be a use-after-free problem here, given that this 
data extractor will refer to the stack object?

To create persistent data, you need to use the DataBufferSP constructor, but 
I'm wondering if we couldn't fix this by creating the (non-pointer) object 
using the `CreateValueObjectFromAddress` function, as above, but then actually 
use valobj->AddressOf as the synthetic child.

I am also somewhat surprised that we need to use the GetAddressOf trick here, 
as this seems to indicate that the coroutine contains (in the proper C 
"subobject" kind of way) the promise object. That's not necessarily wrong, but 
it makes me think we may be "breaking the cycle" at the wrong place.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132815/new/

https://reviews.llvm.org/D132815

_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to