This commit implement "enco_dump_block" debugging helper which shows all
the instructions in a given block.
Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
std::cout << desc << std::endl;
}
}
+
+/**
+ * SECTION: Block
+ */
+namespace
+{
+
+pp::LinearDocument describe(const coco::Block *blk)
+{
+ pp::LinearDocument doc;
+
+ for (auto ins = blk->instr()->head(); ins; ins = ins->next())
+ {
+ auto setter = [ins](pp::LinearDocument &doc) { doc.append(describe(ins)); };
+ auto desc = section("instr").build(setter);
+ doc.append(desc);
+ }
+
+ return doc;
+}
+
+} // namespace
+
+DEBUGGING_API_P(enco_dump_block, coco::Block, blk) { std::cout << describe(blk) << std::endl; }
*/
DEBUGGING_API_P(enco_dump_all_instrs, coco::Module);
+/**
+ * Print the details of all the instruction in a given block
+ *
+ * (gdb) call enco_dump_block(b)
+ * (gdb) call enco_dump_block(0x...)
+ */
+DEBUGGING_API_P(enco_dump_block, coco::Block);
+
#undef DEBUGGING_API_P
#endif // __ENCO_SUPPORT_DEBUGGING_H__