fxos/include/fxos/disasm-passes/print.h

56 lines
1.4 KiB
C++

//---
// fxos.disasm-passes.print: Concrete program printer
//
// This pass prints the program and some to all of its annotations, depending
// on the specified parameters.
//---
#ifndef LIBFXOS_DISASM_PASSES_PRINT_H
#define LIBFXOS_DISASM_PASSES_PRINT_H
#include <fxos/disassembly.h>
namespace FxOS {
class PrintPass: public DisassemblyPass
{
public:
PrintPass(Disassembly &disasm);
void analyze(uint32_t pc, ConcreteInstruction &inst) override;
/* This pass uses another entry method that starts at the instruction
with the smallest address loaded in the disassembly, then goes down.
The standard run() is not available. */
void run(void);
//---
// Print pass parameters
//---
/* In jump instructions, hide the raw value "pc+<disp>" if the target
address has been computed */
bool hide_resolved_pcjump;
/* In PC-relative move instructions, hide the raw value "@(<disp>,pc)"
of the argument if the target address has been computed */
bool hide_resolved_pcrel;
/* In PC-relative move instructions, hide the target address of the
argument... under conditions */
enum {
/* Always show the accessed address */
Hide_MovPC_Never,
/* Hide the address if it's in the same memory region as the
instruction doing the move */
Hide_MovPC_Region,
/* Always hide the address */
Hide_MovPC_Always,
} hide_movpc_address;
/* TODO: More print pass parameters */
};
} /* namespace FxOS */
#endif /* LIBFXOS_DISASM_PASSES_PRINT_H */