I've been writing some code to trace through the stack in the middle of a WebAssembly execution. Mostly I've just been using v8::internal::GetCurrentStackPosition() and sorta just guessing when to stop, but this is probably unreliable and unsafe. I see there exists stuff like StackFrameIterator, and other similar looking classes in v8, but I can't quite figure out how to use the,. How can I go about figuring this out a little better?
Basically all I have so far is:
auto isolate = v8::internal::Isolate::Current();
auto stack_memory = v8::internal::wasm::StackMemory::GetCurrentStackView(isolate);
auto iter = v8::internal::StackFrameIterator(isolate, stack_memory);
Which does not work.
My other attempt was to use isolate->wasm_stacks() instead of v8::internal::wasm::StackMemory::GetCurrentStackView(isolate), but this function just seems to return nullptr for me. I don't have any better guesses, so I was hoping someone would know better and be able to give me some direction
Thanks for any help!