mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
Python: CG trace: Improved debugging queries a bit
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user