File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Modules/_remote_debugging Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -115,13 +115,22 @@ get_gc_stats_from_interpreter_state(RuntimeOffsets *offsets,
115115 unsigned long iid ,
116116 void * context )
117117{
118- struct gc_stats stats ;
119- uintptr_t gc_stats_address = interpreter_state_addr
118+ uintptr_t gc_stats_addr ;
119+ uintptr_t gc_stats_pointer_address = interpreter_state_addr
120120 + offsets -> debug_offsets .interpreter_state .gc
121121 + offsets -> debug_offsets .gc .generation_stats ;
122+ if (_Py_RemoteDebug_ReadRemoteMemory (& offsets -> handle ,
123+ gc_stats_pointer_address ,
124+ sizeof (gc_stats_addr ),
125+ & gc_stats_addr ) < 0 ) {
126+ PyErr_SetString (PyExc_RuntimeError , "Failed to read GC state address" );
127+ return -1 ;
128+ }
129+
130+ struct gc_stats stats ;
122131 uint64_t gc_stats_size = offsets -> debug_offsets .gc .generation_stats_size ;
123132 if (_Py_RemoteDebug_ReadRemoteMemory (& offsets -> handle ,
124- gc_stats_address ,
133+ gc_stats_addr ,
125134 gc_stats_size ,
126135 & stats ) < 0 ) {
127136 PyErr_SetString (PyExc_RuntimeError , "Failed to read GC state" );
You can’t perform that action at this time.
0 commit comments