Skip to content

Commit

Permalink
dumper: Clean disassembly output
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Sep 23, 2024
1 parent f163928 commit d5556ec
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions dumper/dumper.d
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ import common.errormgmt;
import common.cli : opt_machine, opt_syntax;
import common.utils;

//TODO: Like print_flagsX, something for bit masks: print_mask
// signature: print_mask(name, flags, values...);
// usage: print_mask("something", "something", FLAGS, MASK, FLAG1, FLAG2, etc.)
//TODO: print_wstringl (wide-string)
//TODO: (disassembly) attach shortest and longuest instructions found to buffers
// TODO: Like print_flagsX, something for bit masks: print_mask
// signature: print_mask(name, flags, values...);
// usage: print_mask("something", "something", FLAGS, MASK, FLAG1, FLAG2, etc.)
// TODO: print_wstringl (wide-string)
// TODO: (disassembly) attach shortest and longuest instructions found to buffers

extern (C):
__gshared:
Expand Down Expand Up @@ -249,14 +249,17 @@ void print_disasm_line(adbg_opcode_t *op, const(char)* msg = null) {
left -= l;
}
machine[tl] = 0;
printf(" %*s ", -24, machine.ptr);
printf("%*s ", -24, machine.ptr);

// Print message or mnemonics
// Print the more important message
if (msg) {
puts(msg);
return;
}
printf("%*s %s\n", -10, op.mnemonic, op.operands);

printf(op.mnemonic);
if (op.operands) printf("\t%s", op.operands);
putchar('\n');
}

void print_u8(const(char)* name, ubyte val, const(char) *meaning = null) {
Expand Down

0 comments on commit d5556ec

Please sign in to comment.