Closed godlygeek closed 5 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 92.84%. Comparing base (
41248ed
) to head (8e914a7
). Report is 58 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
memray attach
needs to inject some custom code into the process it has attached to. It does this by usingdlopen
and then calling a function we control, but that can't be done just anywhere: we need to ensure we're not currently in the middle of a call todlopen
, or in the middle of a call tomalloc
, etc.To work around this, we set a handful of breakpoints for known safe (probably) places to call into our custom code, and load and call it only when the breakpoint is hit.
Add 2 new breakpoints to our gdb script, on
PyCallable_Check
andPyError_CheckSignals
. Also, usePy_AddPendingCall
to schedule a call toPyCallable_Check
on the main thread, in the hopes of triggering one of our breakpoints to happen sooner.For now, apply this only to our gdb script, and not to our lldb script. Making the analogous changes to the lldb script results in lldb on Linux stopping at an already-deleted breakpoint, and I haven't figured out a workaround or fix for that yet.