MCPcopy Index your code
hub / github.com/python/cpython / print_instruction

Method print_instruction

Lib/dis.py:464–480  ·  view source on GitHub ↗
(self, instr, mark_as_current=False)

Source from the content-addressed store, hash-verified

462 self.show_positions = show_positions
463
464 def print_instruction(self, instr, mark_as_current=False):
465 self.print_instruction_line(instr, mark_as_current)
466 if self.show_caches and instr.cache_info:
467 offset = instr.offset
468 for name, size, data in instr.cache_info:
469 for i in range(size):
470 offset += 2
471 # Only show the fancy argrepr for a CACHE instruction when it's
472 # the first entry for a particular cache value:
473 if i == 0:
474 argrepr = f"{name}: {int.from_bytes(data, sys.byteorder)}"
475 else:
476 argrepr = ""
477 self.print_instruction_line(
478 Instruction("CACHE", CACHE, 0, None, argrepr, offset, offset,
479 False, None, None, instr.positions),
480 False)
481
482 def print_instruction_line(self, instr, mark_as_current):
483 """Format instruction details for inclusion in disassembly output."""

Callers 2

__str__Method · 0.95
print_instructionsFunction · 0.80

Calls 2

InstructionClass · 0.70

Tested by

no test coverage detected