Skip to content

Commit 09adbd8

Browse files
chore(profiling): import latest echion changes
Specifically commit bbb0c5d2c328765e5548912f9951f20b1baa8b7d
1 parent 22850ff commit 09adbd8

File tree

1 file changed

+5
-1
lines changed
  • ddtrace/internal/datadog/profiling/stack_v2/echion/echion/cpython

1 file changed

+5
-1
lines changed

ddtrace/internal/datadog/profiling/stack_v2/echion/echion/cpython/tasks.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,12 @@ extern "C"
198198
return NULL;
199199

200200
auto localsplus = std::make_unique<PyObject*[]>(frame.stacktop);
201-
if (copy_generic(frame.localsplus, localsplus.get(), frame.stacktop * sizeof(PyObject*)))
201+
// Calculate the remote address of the localsplus array
202+
auto localsplus_addr = reinterpret_cast<uintptr_t>(frame_addr) + offsetof(_PyInterpreterFrame, localsplus);
203+
auto remote_localsplus = reinterpret_cast<PyObject**>(localsplus_addr);
204+
if (copy_generic(remote_localsplus, localsplus.get(), frame.stacktop * sizeof(PyObject*))) {
202205
return NULL;
206+
}
203207

204208
yf = localsplus[frame.stacktop - 1];
205209
}

0 commit comments

Comments
 (0)