Skip to content

Commit ecafc76

Browse files
committed
Python: CG trace: Improved debugging queries a bit
1 parent 2407c8b commit ecafc76

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed
Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
import lib.RecordedCalls
22

3-
from UnidentifiedRecordedCall rc, XMLCall xml_call
4-
select "Could not uniquely identify this recorded call (either call or callee was not uniquely identified)",
5-
rc, rc.getXMLCall().get_filename_data(), rc.getXMLCall().get_linenum_data(),
6-
rc.getXMLCall().get_inst_index_data()
3+
from UnidentifiedRecordedCall rc, string reason
4+
where
5+
not rc instanceof IgnoredRecordedCall and
6+
(
7+
not exists(rc.getACall()) and
8+
reason = "no call"
9+
or
10+
count(rc.getACall()) > 1 and
11+
reason = "more than 1 call"
12+
or
13+
not exists(rc.getAPythonCallee()) and
14+
not exists(rc.getABuiltinCallee()) and
15+
reason = "no callee"
16+
or
17+
count(rc.getAPythonCallee()) > 1 and
18+
reason = "more than 1 Python callee"
19+
or
20+
count(rc.getABuiltinCallee()) > 1 and
21+
reason = "more than 1 Builtin callee"
22+
)
23+
select rc, reason
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import python
2+
import lib.RecordedCalls
3+
4+
// Could be useful for deciding which new opcodes to support
5+
from string op_name, int c
6+
where
7+
exists(XMLBytecodeUnknown unknown | unknown.get_opname_data() = op_name) and
8+
c = count(XMLBytecodeUnknown unknown | unknown.get_opname_data() = op_name | 1)
9+
select op_name, c order by c

0 commit comments

Comments
 (0)