#include "fxos-cli.h" #include #include using namespace FxOS; /* Print the details of a single target on standard output */ void show_target(std::string name, Target const &target) { printf(" %s:", name.c_str()); for(Target::Binding const &b: target.bindings) { MemoryRegion const ® = b.first; if(reg.name != "") printf(" %s", reg.name.c_str()); else printf(" %08x(%x)", reg.start, reg.size()); } printf("\n"); } void show_library(FxOS::Library &library, bool targets, bool asmtables) { if(targets) { printf("Targets:\n"); for(auto &pair: library.targets()) { show_target(pair.first, pair.second); } } if(asmtables) { printf("Assembly tables:\n"); for(auto const &pair: library.asm_tables()) { std::string const &name = pair.first; int instruction_count = pair.second; printf(" %s (%d instructions)\n", name.c_str(), instruction_count); } } }