ACPI AML decompiler w/ CFG recovery and structured pseudocode
29

Configure Feed

Select the types of activity you want to include in your feed.

Stabilise graph rendering behaviour w cfg ast and namespace DOT snapshot coverage

+61
+61
test/t_snap.c
··· 68 68 "}\n"; 69 69 T_CHECK(strcmp(d, dwant) == 0); 70 70 free(d); 71 + 72 + char *g = tobi_graph_dot(r.root, &r.ns, TOBI_GRAPH_CFG); 73 + const char *cfg_want = 74 + "digraph tobi_cfg {\n" 75 + " graph [rankdir=TB,bgcolor=\"#ffffff\",pad=0.18,nodesep=0.5,ranksep=0.72,splines=ortho,outputorder=edgesfirst];\n" 76 + " node [shape=box,style=\"solid\",color=\"#000000\",fontcolor=\"#000000\",fontname=\"Courier\",fontsize=12,margin=\"0.12,0.07\",penwidth=1.1];\n" 77 + " edge [color=\"#000000\",fontcolor=\"#000000\",arrowsize=0.75,penwidth=1.1];\n" 78 + " n0 [label=\"root\\noff=0x0\"];\n" 79 + " n1 [label=\"method\\nMTH0\\noff=0x0\"];\n" 80 + " n2 [label=\"store\\noff=0x7\"];\n" 81 + " e0 [shape=box,style=\"solid\",color=\"#000000\",fontcolor=\"#000000\",fontname=\"Times-Roman\",fontsize=10,margin=\"0.06,0.03\",height=0,width=0,label=\"entry\"];\n" 82 + " n1 -> e0 [arrowhead=none, weight=2];\n" 83 + " e0 -> n2 [weight=2];\n" 84 + " n3 [label=\"return\\noff=0xb\"];\n" 85 + " e1 [shape=box,style=\"solid\",color=\"#000000\",fontcolor=\"#000000\",fontname=\"Times-Roman\",fontsize=10,margin=\"0.06,0.03\",height=0,width=0,label=\"next\"];\n" 86 + " n2 -> e1 [arrowhead=none, weight=2];\n" 87 + " e1 -> n3 [weight=2];\n" 88 + " e2 [shape=box,style=\"solid\",color=\"#000000\",fontcolor=\"#000000\",fontname=\"Times-Roman\",fontsize=10,margin=\"0.06,0.03\",height=0,width=0,label=\"entry\"];\n" 89 + " n0 -> e2 [arrowhead=none, weight=2];\n" 90 + " e2 -> n1 [weight=2];\n" 91 + "}\n"; 92 + T_CHECK(strcmp(g, cfg_want) == 0); 93 + free(g); 94 + 95 + g = tobi_graph_dot(r.root, &r.ns, TOBI_GRAPH_AST); 96 + const char *ast_want = 97 + "digraph tobi_ast {\n" 98 + " graph [rankdir=TB,bgcolor=\"#ffffff\",pad=0.18,nodesep=0.5,ranksep=0.72,splines=ortho,outputorder=edgesfirst];\n" 99 + " node [shape=box,style=\"solid\",color=\"#000000\",fontcolor=\"#000000\",fontname=\"Courier\",fontsize=12,margin=\"0.12,0.07\",penwidth=1.1];\n" 100 + " edge [color=\"#000000\",fontcolor=\"#000000\",arrowsize=0.75,penwidth=1.1];\n" 101 + " n0 [label=\"root\\noff=0x0\"];\n" 102 + " n1 [label=\"method\\nMTH0\\noff=0x0\"];\n" 103 + " n2 [label=\"block\\noff=0x7\"];\n" 104 + " n3 [label=\"store\\noff=0x7\"];\n" 105 + " n4 [label=\"integer\\noff=0x8\"];\n" 106 + " n3 -> n4;\n" 107 + " n5 [label=\"ref\\nLocal0\\noff=0xa\"];\n" 108 + " n3 -> n5;\n" 109 + " n2 -> n3;\n" 110 + " n6 [label=\"return\\noff=0xb\"];\n" 111 + " n7 [label=\"ref\\nLocal0\\noff=0xc\"];\n" 112 + " n6 -> n7;\n" 113 + " n2 -> n6;\n" 114 + " n1 -> n2;\n" 115 + " n0 -> n1;\n" 116 + "}\n"; 117 + T_CHECK(strcmp(g, ast_want) == 0); 118 + free(g); 119 + 120 + g = tobi_graph_dot(r.root, &r.ns, TOBI_GRAPH_NAMESPACE); 121 + const char *ns_want = 122 + "digraph tobi_namespace {\n" 123 + " graph [rankdir=TB,bgcolor=\"#ffffff\",pad=0.18,nodesep=0.5,ranksep=0.72,splines=ortho,outputorder=edgesfirst];\n" 124 + " node [shape=box,style=\"solid\",color=\"#000000\",fontcolor=\"#000000\",fontname=\"Courier\",fontsize=12,margin=\"0.12,0.07\",penwidth=1.1];\n" 125 + " edge [color=\"#000000\",fontcolor=\"#000000\",arrowsize=0.75,penwidth=1.1];\n" 126 + " n0 [label=\"namespace\\n\\\\\"];\n" 127 + " n1 [label=\"method\\nMTH0\\n\\\\MTH0\\noff=0x0\"];\n" 128 + " n0 -> n1;\n" 129 + "}\n"; 130 + T_CHECK(strcmp(g, ns_want) == 0); 131 + free(g); 71 132 tobi_parse_result_free(&r); 72 133 73 134 uint8_t nested[] = {