Files
clang-p2996/clang/test/Analysis/exploded-graph-rewriter/trimmers.dot
Artem Dergachev 9289681ea3 [analyzer] exploded-graph-rewriter: Implement manual graph trimming.
When -trim-egraph is unavailable (say, when you're debugging a crash on
a real-world code that takes too long to reduce), it makes sense to view
the untrimmed graph up to the crashing node's predecessor, then dump the ID
(or a pointer) of the node in the attached debugger, and then trim
the dumped graph in order to keep only paths from the root to the node.

The newly added --to flag does exactly that:

$ exploded-graph-rewriter.py ExprEngine.dot --to 0x12229acd0

Multiple nodes can be specified. Stable IDs of nodes can be used
instead of pointers.

Differential Revision: https://reviews.llvm.org/D65345

llvm-svn: 368768
2019-08-13 23:04:53 +00:00

48 lines
1.7 KiB
Plaintext

// RUN: %exploded_graph_rewriter %s \
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,THREE,FOUR
// RUN: %exploded_graph_rewriter -s %s \
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,FOUR
// RUN: %exploded_graph_rewriter --to=0x2 %s \
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,NOFOUR
// RUN: %exploded_graph_rewriter --to 2 %s \
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,NOFOUR
// RUN: %exploded_graph_rewriter --to 2,3 %s \
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,THREE,NOFOUR
// RUN: %exploded_graph_rewriter --to 4 %s \
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,THREE,FOUR
// RUN: %exploded_graph_rewriter --to 4 -s %s \
// RUN: | FileCheck %s -check-prefixes=ONE,TWO,NOTHREE,FOUR
// FIXME: Substitution doesn't seem to work on Windows.
// UNSUPPORTED: system-windows
Node0x1 [shape=record,label=
"{{ "node_id": 1, "pointer": "0x1", "has_report": false, "is_sink": false,
"program_state": null, "program_points": []}\l}"];
Node0x2 [shape=record,label=
"{{ "node_id": 2, "pointer": "0x2", "has_report": false, "is_sink": false,
"program_state": null, "program_points": []}\l}"];
Node0x3 [shape=record,label=
"{{ "node_id": 3, "pointer": "0x3", "has_report": false, "is_sink": false,
"program_state": null, "program_points": []}\l}"];
Node0x4 [shape=record,label=
"{{ "node_id": 4, "pointer": "0x4", "has_report": false, "is_sink": false,
"program_state": null, "program_points": []}\l}"];
Node0x1 -> Node0x2;
Node0x1 -> Node0x3;
Node0x2 -> Node0x4;
Node0x3 -> Node0x4;
// ONE: Node0x1
// NOTONE-NOT: Node0x1
// TWO: Node0x2
// NOTTWO-NOT: Node0x2
// THREE: Node0x3
// NOTTHREE-NOT: Node0x3
// FOUR: Node0x4
// NOTFOUR-NOT: Node0x4