|
11 | 11 | #include "pycore_pystate.h"
|
12 | 12 |
|
13 | 13 | /* Uncomment this to dump debugging output when assertions fail */
|
14 |
| -// #define INSTRUMENT_DEBUG 1 |
| 14 | +#define INSTRUMENT_DEBUG 1 |
15 | 15 |
|
16 | 16 | static PyObject DISABLE =
|
17 | 17 | {
|
@@ -401,7 +401,6 @@ dump_instrumentation_data(PyCodeObject *code, int star, FILE*out)
|
401 | 401 | dump_instrumentation_data_lines(code, data->lines, i, out);
|
402 | 402 | dump_instrumentation_data_line_tools(code, data->line_tools, i, out);
|
403 | 403 | dump_instrumentation_data_per_instruction(code, data, i, out);
|
404 |
| - /* TO DO -- per instruction data */ |
405 | 404 | fprintf(out, "\n");
|
406 | 405 | ;
|
407 | 406 | }
|
@@ -462,7 +461,10 @@ sanity_check_instrumentation(PyCodeObject *code)
|
462 | 461 | if (!is_instrumented(opcode)) {
|
463 | 462 | CHECK(_PyOpcode_Deopt[opcode] == opcode);
|
464 | 463 | }
|
465 |
| - /* TO DO -- check tools */ |
| 464 | + if (data->per_instruction_tools) { |
| 465 | + uint8_t tools = active_monitors.tools[PY_MONITORING_EVENT_INSTRUCTION]; |
| 466 | + CHECK((tools & data->per_instruction_tools[i]) == data->per_instruction_tools[i]); |
| 467 | + } |
466 | 468 | }
|
467 | 469 | if (opcode == INSTRUMENTED_LINE) {
|
468 | 470 | CHECK(data->lines);
|
@@ -498,7 +500,7 @@ sanity_check_instrumentation(PyCodeObject *code)
|
498 | 500 | CHECK(valid_opcode(opcode));
|
499 | 501 | if (data->tools) {
|
500 | 502 | uint8_t local_tools = data->tools[i];
|
501 |
| - if (OPCODE_HAS_EVENT[base_opcode]) { |
| 503 | + if (opcode_has_event(base_opcode)) { |
502 | 504 | int event = EVENT_FOR_OPCODE[base_opcode];
|
503 | 505 | if (event == -1) {
|
504 | 506 | /* RESUME fixup */
|
|
0 commit comments