Add opcode utilities and --opcodes CLI flag

New opcode_utils.py maps opcode numbers to names and detects specialized
variants using opcode module metadata. Adds normalize_location() and
extract_lineno() helpers to collector base for uniform location handling.

CLI gains --opcodes flag, validated against compatible formats (gecko,
flamegraph, heatmap, live).
This commit is contained in:
Pablo Galindo Salgado 2025-12-03 03:43:10 +00:00
parent dd27e5e679
commit 70f2ae025f
5 changed files with 161 additions and 7 deletions

View file

@ -14,6 +14,10 @@
SORT_MODE_CUMUL_PCT = 4
SORT_MODE_NSAMPLES_CUMUL = 5
# Default location for synthetic frames (native, GC) that have no source location
# Format: (lineno, end_lineno, col_offset, end_col_offset)
DEFAULT_LOCATION = (0, 0, -1, -1)
# Thread status flags
try:
from _remote_debugging import (