Python: CG trace: Improved debugging queries a bit

This commit is contained in:
Rasmus Wriedt Larsen
2020-07-24 19:34:51 +02:00
parent 2407c8b07e
commit ecafc760e8
2 changed files with 30 additions and 4 deletions

View File

@@ -1,6 +1,23 @@
import lib.RecordedCalls
from UnidentifiedRecordedCall rc, XMLCall xml_call
select "Could not uniquely identify this recorded call (either call or callee was not uniquely identified)",
rc, rc.getXMLCall().get_filename_data(), rc.getXMLCall().get_linenum_data(),
rc.getXMLCall().get_inst_index_data()
from UnidentifiedRecordedCall rc, string reason
where
not rc instanceof IgnoredRecordedCall and
(
not exists(rc.getACall()) and
reason = "no call"
or
count(rc.getACall()) > 1 and
reason = "more than 1 call"
or
not exists(rc.getAPythonCallee()) and
not exists(rc.getABuiltinCallee()) and
reason = "no callee"
or
count(rc.getAPythonCallee()) > 1 and
reason = "more than 1 Python callee"
or
count(rc.getABuiltinCallee()) > 1 and
reason = "more than 1 Builtin callee"
)
select rc, reason

View File

@@ -0,0 +1,9 @@
import python
import lib.RecordedCalls
// Could be useful for deciding which new opcodes to support
from string op_name, int c
where
exists(XMLBytecodeUnknown unknown | unknown.get_opname_data() = op_name) and
c = count(XMLBytecodeUnknown unknown | unknown.get_opname_data() = op_name | 1)
select op_name, c order by c