diff -rupN dynamips-0.2.7/dev_vtty.c dynamips-0.2.7-working/dev_vtty.c --- dynamips-0.2.7/dev_vtty.c 2007-05-26 11:52:33.000000000 +0200 +++ dynamips-0.2.7-working/dev_vtty.c 2009-06-18 15:49:30.000000000 +0200 @@ -1004,6 +1004,7 @@ void vtty_put_char(vtty_t *vtty, char ch vm_log(vtty->vm,"VTTY","%s: put char %d failed (%s)\n", vtty->name,(int)ch,strerror(errno)); } + fflush(vtty->fstream); break; case VTTY_TYPE_SERIAL: diff -rupN dynamips-0.2.7/ppc32_exec.c dynamips-0.2.7-working/ppc32_exec.c --- dynamips-0.2.7/ppc32_exec.c 2007-05-26 11:52:33.000000000 +0200 +++ dynamips-0.2.7-working/ppc32_exec.c 2009-06-20 08:53:09.000000000 +0200 @@ -228,6 +228,23 @@ void *ppc32_exec_run_cpu(cpu_gen_t *gen) /* Normal flow ? */ if (likely(!res)) cpu->ia += sizeof(ppc_insn_t); + + // Handle single-stepping here if the single-step bit is set + if (cpu->msr & PPC32_MSR_SE) + { + // I am not totally sure what happens here. This piece of + // code was added to make single-stepping work with the GDB + // server on the Cisco 2600 work. Every time we single step using + // that GDB server we return from an interrupt (rfi) with the + // SE bit set. The next instruction is the one being single-stepped + // then. That next instruction is the one executed below. + + ppc32_exec_fetch(cpu, cpu->ia, &insn); + res = ppc32_exec_single_instruction(cpu, insn); + + if (!res) cpu->ia += sizeof(ppc_insn_t); + ppc32_trigger_exception(cpu, PPC32_EXC_TRACE); + } } /* Check regularly if the CPU has been restarted */