forked from Lephenixnoir/fxos
print: show ellipses when addresses jump in output
This commit is contained in:
parent
2e58a8850b
commit
772a67e35e
|
@ -63,6 +63,9 @@ private:
|
|||
/* OS for the target, to mark syscalls before instructions */
|
||||
std::unique_ptr<OS> m_os;
|
||||
|
||||
/* Last printed address (for ellipses) */
|
||||
uint32_t m_last_address;
|
||||
|
||||
/** Internal promotion tree printers **/
|
||||
|
||||
void queue(std::string, bool = false);
|
||||
|
|
|
@ -11,7 +11,8 @@ namespace FxOS {
|
|||
|
||||
PrintPass::PrintPass(Disassembly &disasm,
|
||||
std::vector<SymbolTable> const &symtables):
|
||||
InstructionDisassemblyPass(disasm, "print"), m_symtables(symtables)
|
||||
InstructionDisassemblyPass(disasm, "print"), m_symtables(symtables),
|
||||
m_last_address(0xffffffff)
|
||||
{
|
||||
/* Default parameters: all 0 */
|
||||
|
||||
|
@ -27,6 +28,11 @@ void PrintPass::analyze(uint32_t pc, ConcreteInstruction &ci)
|
|||
{
|
||||
Instruction const *i = ci.inst;
|
||||
|
||||
/* Ellipsis if there is a gap since last instruction */
|
||||
|
||||
if(m_last_address+1 != 0 && pc != m_last_address+2)
|
||||
printf(" ...\n");
|
||||
|
||||
/* Preliminary syscall number */
|
||||
|
||||
int syscall_id;
|
||||
|
@ -95,6 +101,7 @@ void PrintPass::analyze(uint32_t pc, ConcreteInstruction &ci)
|
|||
}
|
||||
|
||||
printf("\n");
|
||||
m_last_address = pc;
|
||||
}
|
||||
|
||||
std::optional<std::string> PrintPass::symquery(Symbol::Type type,
|
||||
|
|
Loading…
Reference in New Issue