core: debugger: Fix dissassembly
Former-commit-id: ec8d6726eb1f599e43b0826e99508cc954454220 Former-commit-id: 3b64d5b60377c303b85be32794df18671002d509
This commit is contained in:
parent
626c5fa805
commit
7512bad3a0
|
@ -184,15 +184,16 @@ impl Debugger {
|
||||||
MemWriteCommandSize::Word => gba.sysbus.write_32(addr, val as u32),
|
MemWriteCommandSize::Word => gba.sysbus.write_32(addr, val as u32),
|
||||||
},
|
},
|
||||||
Disass(mode, addr, n) => {
|
Disass(mode, addr, n) => {
|
||||||
let bytes = gba.sysbus.debug_get_bytes(addr..addr + n);
|
|
||||||
match mode {
|
match mode {
|
||||||
DisassMode::ModeArm => {
|
DisassMode::ModeArm => {
|
||||||
|
let bytes = gba.sysbus.debug_get_bytes(addr..addr + 4 * n);
|
||||||
let disass = Disassembler::<ArmInstruction>::new(addr, &bytes);
|
let disass = Disassembler::<ArmInstruction>::new(addr, &bytes);
|
||||||
for (_, line) in disass.take(n as usize) {
|
for (_, line) in disass.take(n as usize) {
|
||||||
println!("{}", line)
|
println!("{}", line)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DisassMode::ModeThumb => {
|
DisassMode::ModeThumb => {
|
||||||
|
let bytes = gba.sysbus.debug_get_bytes(addr..addr + 2 * n);
|
||||||
let disass = Disassembler::<ThumbInstruction>::new(addr, &bytes);
|
let disass = Disassembler::<ThumbInstruction>::new(addr, &bytes);
|
||||||
for (_, line) in disass.take(n as usize) {
|
for (_, line) in disass.take(n as usize) {
|
||||||
println!("{}", line)
|
println!("{}", line)
|
||||||
|
@ -331,7 +332,7 @@ impl Debugger {
|
||||||
}
|
}
|
||||||
0 => {
|
0 => {
|
||||||
if let Some(Command::Disass(_mode, addr, n)) = &self.previous_command {
|
if let Some(Command::Disass(_mode, addr, n)) = &self.previous_command {
|
||||||
Ok((*addr + (4 * (*n as u32)), 10))
|
Ok((*addr + (*n as u32), 10))
|
||||||
} else {
|
} else {
|
||||||
Ok((gba.cpu.get_next_pc(), 10))
|
Ok((gba.cpu.get_next_pc(), 10))
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue