mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python: CG trace: Nicer logging
This commit is contained in:
@@ -176,7 +176,9 @@ def expr_from_instruction(instructions: List[Instruction], index: int) -> Byteco
|
||||
def expr_from_frame(frame: FrameType) -> BytecodeExpr:
|
||||
bytecode = dis.Bytecode(frame.f_code, current_offset=frame.f_lasti)
|
||||
|
||||
LOGGER.debug(f"bytecode: \n{bytecode.dis()}")
|
||||
LOGGER.debug(
|
||||
f"{frame.f_code.co_filename}:{frame.f_lineno}: bytecode: \n{bytecode.dis()}"
|
||||
)
|
||||
|
||||
instructions = list(iter(bytecode))
|
||||
last_instruction_index = [inst.offset for inst in instructions].index(frame.f_lasti)
|
||||
|
||||
@@ -50,7 +50,7 @@ class Call:
|
||||
del d["bytecode_expr"]
|
||||
normal_fields = ", ".join(f"{k}={v!r}" for k, v in d.items())
|
||||
|
||||
return f"{type(self).__name__}({normal_fields}, bytecode_expr≈{repr(str(self.bytecode_expr))})"
|
||||
return f"{type(self).__name__}({normal_fields}, bytecode_expr≈{str(self.bytecode_expr)})"
|
||||
|
||||
@classmethod
|
||||
def from_frame(cls, frame: FrameType):
|
||||
|
||||
Reference in New Issue
Block a user