| 1181 | } |
| 1182 | |
| 1183 | void |
| 1184 | AbstractProcessManager::clampSizes(python_v& debug_offsets) const |
| 1185 | { |
| 1186 | // Clamp the size of each struct down to only what we need to copy. |
| 1187 | // The runtime state and interpreter state both contain many fields beyond |
| 1188 | // the ones that we're interested in or have offsets for. |
| 1189 | #define update_size(structure, field) \ |
| 1190 | debug_offsets.structure.size = std::max( \ |
| 1191 | (size_t)debug_offsets.structure.size, \ |
| 1192 | debug_offsets.structure.field.offset \ |
| 1193 | + sizeof(decltype(debug_offsets.structure.field)::Type)) |
| 1194 | |
| 1195 | debug_offsets.py_runtime.size = 0; |
| 1196 | update_size(py_runtime, o_finalizing); |
| 1197 | update_size(py_runtime, o_interp_head); |
| 1198 | |
| 1199 | debug_offsets.py_is.size = 0; |
| 1200 | update_size(py_is, o_next); |
| 1201 | update_size(py_is, o_tstate_head); |
| 1202 | update_size(py_is, o_gc); |
| 1203 | update_size(py_is, o_modules); |
| 1204 | update_size(py_is, o_sysdict); |
| 1205 | update_size(py_is, o_builtins); |
| 1206 | update_size(py_is, o_gil_runtime_state); |
| 1207 | |
| 1208 | debug_offsets.py_thread.size = 0; |
| 1209 | update_size(py_thread, o_prev); |
| 1210 | update_size(py_thread, o_next); |
| 1211 | update_size(py_thread, o_interp); |
| 1212 | update_size(py_thread, o_frame); |
| 1213 | update_size(py_thread, o_thread_id); |
| 1214 | update_size(py_thread, o_native_thread_id); |
| 1215 | |
| 1216 | debug_offsets.py_frame.size = 0; |
| 1217 | update_size(py_frame, o_back); |
| 1218 | update_size(py_frame, o_code); |
| 1219 | update_size(py_frame, o_prev_instr); |
| 1220 | update_size(py_frame, o_localsplus); |
| 1221 | update_size(py_frame, o_owner); |
| 1222 | |
| 1223 | debug_offsets.py_code.size = 0; |
| 1224 | update_size(py_code, o_filename); |
| 1225 | update_size(py_code, o_name); |
| 1226 | update_size(py_code, o_lnotab); |
| 1227 | update_size(py_code, o_firstlineno); |
| 1228 | update_size(py_code, o_argcount); |
| 1229 | update_size(py_code, o_varnames); |
| 1230 | update_size(py_code, o_code_adaptive); |
| 1231 | |
| 1232 | debug_offsets.py_object.size = 0; |
| 1233 | update_size(py_object, o_ob_type); |
| 1234 | |
| 1235 | debug_offsets.py_type.size = 0; |
| 1236 | update_size(py_type, o_tp_name); |
| 1237 | update_size(py_type, o_tp_repr); |
| 1238 | update_size(py_type, o_tp_flags); |
| 1239 | |
| 1240 | debug_offsets.py_tuple.size = 0; |
nothing calls this directly
no outgoing calls
no test coverage detected