Line 49... |
Line 49... |
#include "gdbcomm.h"
|
#include "gdbcomm.h"
|
#include "debug_unit.h"
|
#include "debug_unit.h"
|
#include "coff.h"
|
#include "coff.h"
|
|
|
/* CVS revision number. */
|
/* CVS revision number. */
|
const char rcsrev[] = "$Revision: 1.64 $";
|
const char rcsrev[] = "$Revision: 1.65 $";
|
|
|
/* Continuos run versus single step tracing switch. */
|
/* Continuos run versus single step tracing switch. */
|
int cont_run;
|
int cont_run;
|
|
|
/* History of execution */
|
/* History of execution */
|
Line 241... |
Line 241... |
config.debug.gdb_enabled = 0;
|
config.debug.gdb_enabled = 0;
|
if (config.sim.verbose)
|
if (config.sim.verbose)
|
fprintf (stderr, "WARNING: Debug module not enabled, cannot start gdb.\n");
|
fprintf (stderr, "WARNING: Debug module not enabled, cannot start gdb.\n");
|
}
|
}
|
|
|
if (GDB_ENABLED)
|
if (config.debug.gdb_enabled)
|
gdbcomm_init ();
|
gdbcomm_init ();
|
|
|
/* Enable dependency stats, if we want to do history analisis */
|
/* Enable dependency stats, if we want to do history analisis */
|
if (config.sim.history && !config.cpu.dependstats) {
|
if (config.sim.history && !config.cpu.dependstats) {
|
config.cpu.dependstats = 1;
|
config.cpu.dependstats = 1;
|
Line 370... |
Line 370... |
sim_init ();
|
sim_init ();
|
signal(SIGINT, ctrl_c);
|
signal(SIGINT, ctrl_c);
|
|
|
while(1) {
|
while(1) {
|
if (config.sim.iprompt) {
|
if (config.sim.iprompt) {
|
if (GDB_ENABLED)
|
if (config.debug.gdb_enabled)
|
{
|
{
|
printf ("(sim) ");
|
printf ("(sim) ");
|
fflush(stdout);
|
fflush(stdout);
|
HandleServerSocket(true); /* block & check_stdin = true */
|
HandleServerSocket(true); /* block & check_stdin = true */
|
}
|
}
|
#ifdef HAVE_LIBREADLINE
|
#ifdef HAVE_LIBREADLINE
|
/* Must disable readline in new mode. It isn't compatible
|
/* Must disable readline in new mode. It isn't compatible
|
with non blocking environments */
|
with non blocking environments */
|
if(!GDB_ENABLED)
|
if(!config.debug.gdb_enabled)
|
linestr = readline("(sim) ");
|
linestr = readline("(sim) ");
|
else
|
else
|
linestr = fgets(b2, sizeof b2, stdin);
|
linestr = fgets(b2, sizeof b2, stdin);
|
#else
|
#else
|
if(!GDB_ENABLED)
|
if(!config.debug.gdb_enabled)
|
printf ("(sim) ");
|
printf ("(sim) ");
|
linestr = fgets(b2, sizeof b2, stdin);
|
linestr = fgets(b2, sizeof b2, stdin);
|
#endif
|
#endif
|
} else
|
} else
|
strcpy(linestr = b2, "run -1 hush");
|
strcpy(linestr = b2, "run -1 hush");
|
Line 628... |
Line 628... |
int debug_slowdown = DEBUG_SLOWDOWN;
|
int debug_slowdown = DEBUG_SLOWDOWN;
|
extern int mem_cycles;
|
extern int mem_cycles;
|
|
|
if (cpu_stalled) {
|
if (cpu_stalled) {
|
printf ("!");
|
printf ("!");
|
if(GDB_ENABLED) {
|
if(config.debug.gdb_enabled) {
|
BlockJTAG();
|
BlockJTAG();
|
HandleServerSocket(false);
|
HandleServerSocket(false);
|
} else
|
} else
|
fprintf (stderr, "WARNING: CPU stalled and gdb connection not enabled.");
|
fprintf (stderr, "WARNING: CPU stalled and gdb connection not enabled.");
|
continue;
|
continue;
|
Line 662... |
Line 662... |
if (config.uarts) uart_clock();
|
if (config.uarts) uart_clock();
|
if (config.dmas) dma_clock();
|
if (config.dmas) dma_clock();
|
if (config.ethernets) eth_clock();
|
if (config.ethernets) eth_clock();
|
if (config.ngpios) gpio_clock();
|
if (config.ngpios) gpio_clock();
|
if (config.vapi.enabled) vapi_check();
|
if (config.vapi.enabled) vapi_check();
|
if (GDB_ENABLED) {// && ((debug_slowdown--) <= 0)) {
|
if (config.debug.gdb_enabled) {// && ((debug_slowdown--) <= 0)) {
|
debug_slowdown = DEBUG_SLOWDOWN;
|
debug_slowdown = DEBUG_SLOWDOWN;
|
HandleServerSocket(false); /* block & check_stdin = false */
|
HandleServerSocket(false); /* block & check_stdin = false */
|
debug (1, ".");
|
debug (1, ".");
|
}
|
}
|
if (DEBUG_ENABLED)
|
if (config.debug.enabled)
|
if (testsprbits(SPR_DMR1, SPR_DMR1_ST)) set_stall_state (1);
|
if (testsprbits(SPR_DMR1, SPR_DMR1_ST)) set_stall_state (1);
|
cycles += mem_cycles;
|
cycles += mem_cycles;
|
if (!hush) dumpreg();
|
if (!hush) dumpreg();
|
if (config.sim.exe_log) dump_exe_log();
|
if (config.sim.exe_log) dump_exe_log();
|
}
|
}
|