mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2025-01-19 07:24:48 +00:00
2010-04-20 Tiemen Schut <T.Schut@sron.nl>
* erc32.c (sis_memory_write): Change prototype to const unsigned char *. * func.c (exec_cmd, event, advance_time, wait_for_irq): Use uint64 for counts. * interf.c (run_sim): Change icount to uint64_t. Use strtol directly. (sim_resume): Specify maximum run time as uint64. * sis.c (run_sim): Change icount to uint64_t. * sis.h: Define uint64 as uint64_t. Change various fields and prototypes to uint64 to support longer simulations.
This commit is contained in:
parent
3390ce3004
commit
941100245a
@ -1,3 +1,14 @@
|
|||||||
|
2010-04-20 Tiemen Schut <T.Schut@sron.nl>
|
||||||
|
|
||||||
|
* erc32.c (sis_memory_write): Change prototype to const unsigned char *.
|
||||||
|
* func.c (exec_cmd, event, advance_time, wait_for_irq): Use uint64
|
||||||
|
for counts.
|
||||||
|
* interf.c (run_sim): Change icount to uint64_t. Use strtol directly.
|
||||||
|
(sim_resume): Specify maximum run time as uint64.
|
||||||
|
* sis.c (run_sim): Change icount to uint64_t.
|
||||||
|
* sis.h: Define uint64 as uint64_t. Change various fields and
|
||||||
|
prototypes to uint64 to support longer simulations.
|
||||||
|
|
||||||
2010-04-14 Mike Frysinger <vapier@gentoo.org>
|
2010-04-14 Mike Frysinger <vapier@gentoo.org>
|
||||||
|
|
||||||
* interp.c (sim_write): Add const to buf arg.
|
* interp.c (sim_write): Add const to buf arg.
|
||||||
|
@ -1860,9 +1860,9 @@ get_mem_ptr(addr, size)
|
|||||||
|
|
||||||
int
|
int
|
||||||
sis_memory_write(addr, data, length)
|
sis_memory_write(addr, data, length)
|
||||||
uint32 addr;
|
uint32 addr;
|
||||||
char *data;
|
const unsigned char *data;
|
||||||
uint32 length;
|
uint32 length;
|
||||||
{
|
{
|
||||||
char *mem;
|
char *mem;
|
||||||
|
|
||||||
|
@ -421,7 +421,7 @@ exec_cmd(sregs, cmd)
|
|||||||
}
|
}
|
||||||
} else if (strncmp(cmd1, "cont", clen) == 0) {
|
} else if (strncmp(cmd1, "cont", clen) == 0) {
|
||||||
if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
|
if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
|
||||||
stat = run_sim(sregs, -1, 0);
|
stat = run_sim(sregs, UINT64_MAX, 0);
|
||||||
} else {
|
} else {
|
||||||
stat = run_sim(sregs, VAL(cmd1), 0);
|
stat = run_sim(sregs, VAL(cmd1), 0);
|
||||||
}
|
}
|
||||||
@ -472,7 +472,7 @@ exec_cmd(sregs, cmd)
|
|||||||
if ((cmd2 = strtok(NULL, " \t\n\r")) != NULL) {
|
if ((cmd2 = strtok(NULL, " \t\n\r")) != NULL) {
|
||||||
stat = run_sim(sregs, VAL(cmd2), 0);
|
stat = run_sim(sregs, VAL(cmd2), 0);
|
||||||
} else {
|
} else {
|
||||||
stat = run_sim(sregs, -1, 0);
|
stat = run_sim(sregs, UINT64_MAX, 0);
|
||||||
}
|
}
|
||||||
daddr = sregs->pc;
|
daddr = sregs->pc;
|
||||||
sim_halt();
|
sim_halt();
|
||||||
@ -544,7 +544,7 @@ exec_cmd(sregs, cmd)
|
|||||||
reset_all();
|
reset_all();
|
||||||
reset_stat(sregs);
|
reset_stat(sregs);
|
||||||
if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
|
if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
|
||||||
stat = run_sim(sregs, -1, 0);
|
stat = run_sim(sregs, UINT64_MAX, 0);
|
||||||
} else {
|
} else {
|
||||||
stat = run_sim(sregs, VAL(cmd1), 0);
|
stat = run_sim(sregs, VAL(cmd1), 0);
|
||||||
}
|
}
|
||||||
@ -560,7 +560,7 @@ exec_cmd(sregs, cmd)
|
|||||||
sim_halt();
|
sim_halt();
|
||||||
} else if (strncmp(cmd1, "tcont", clen) == 0) {
|
} else if (strncmp(cmd1, "tcont", clen) == 0) {
|
||||||
sregs->tlimit = limcalc(sregs->freq);
|
sregs->tlimit = limcalc(sregs->freq);
|
||||||
stat = run_sim(sregs, -1, 0);
|
stat = run_sim(sregs, UINT64_MAX, 0);
|
||||||
daddr = sregs->pc;
|
daddr = sregs->pc;
|
||||||
sim_halt();
|
sim_halt();
|
||||||
} else if (strncmp(cmd1, "tgo", clen) == 0) {
|
} else if (strncmp(cmd1, "tgo", clen) == 0) {
|
||||||
@ -573,7 +573,7 @@ exec_cmd(sregs, cmd)
|
|||||||
sregs->pc = len & ~3;
|
sregs->pc = len & ~3;
|
||||||
sregs->npc = sregs->pc + 4;
|
sregs->npc = sregs->pc + 4;
|
||||||
printf("resuming at 0x%08x\n",sregs->pc);
|
printf("resuming at 0x%08x\n",sregs->pc);
|
||||||
stat = run_sim(sregs, -1, 0);
|
stat = run_sim(sregs, UINT64_MAX, 0);
|
||||||
daddr = sregs->pc;
|
daddr = sregs->pc;
|
||||||
sim_halt();
|
sim_halt();
|
||||||
} else if (strncmp(cmd1, "tlimit", clen) == 0) {
|
} else if (strncmp(cmd1, "tlimit", clen) == 0) {
|
||||||
@ -583,7 +583,7 @@ exec_cmd(sregs, cmd)
|
|||||||
sregs->tlimit / sregs->freq / 1000);
|
sregs->tlimit / sregs->freq / 1000);
|
||||||
} else if (strncmp(cmd1, "tra", clen) == 0) {
|
} else if (strncmp(cmd1, "tra", clen) == 0) {
|
||||||
if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
|
if ((cmd1 = strtok(NULL, " \t\n\r")) == NULL) {
|
||||||
stat = run_sim(sregs, -1, 1);
|
stat = run_sim(sregs, UINT64_MAX, 1);
|
||||||
} else {
|
} else {
|
||||||
stat = run_sim(sregs, VAL(cmd1), 1);
|
stat = run_sim(sregs, VAL(cmd1), 1);
|
||||||
}
|
}
|
||||||
@ -595,7 +595,7 @@ exec_cmd(sregs, cmd)
|
|||||||
reset_all();
|
reset_all();
|
||||||
reset_stat(sregs);
|
reset_stat(sregs);
|
||||||
sregs->tlimit = limcalc(sregs->freq);
|
sregs->tlimit = limcalc(sregs->freq);
|
||||||
stat = run_sim(sregs, -1, 0);
|
stat = run_sim(sregs, UINT64_MAX, 0);
|
||||||
daddr = sregs->pc;
|
daddr = sregs->pc;
|
||||||
sim_halt();
|
sim_halt();
|
||||||
} else
|
} else
|
||||||
@ -833,7 +833,7 @@ void
|
|||||||
event(cfunc, arg, delta)
|
event(cfunc, arg, delta)
|
||||||
void (*cfunc) ();
|
void (*cfunc) ();
|
||||||
int32 arg;
|
int32 arg;
|
||||||
uint32 delta;
|
uint64 delta;
|
||||||
{
|
{
|
||||||
struct evcell *ev1, *evins;
|
struct evcell *ev1, *evins;
|
||||||
|
|
||||||
@ -900,7 +900,8 @@ advance_time(sregs)
|
|||||||
|
|
||||||
struct evcell *evrem;
|
struct evcell *evrem;
|
||||||
void (*cfunc) ();
|
void (*cfunc) ();
|
||||||
uint32 arg, endtime;
|
uint32 arg;
|
||||||
|
uint64 endtime;
|
||||||
|
|
||||||
#ifdef STAT
|
#ifdef STAT
|
||||||
sregs->fholdt += sregs->fhold;
|
sregs->fholdt += sregs->fhold;
|
||||||
@ -938,7 +939,8 @@ wait_for_irq()
|
|||||||
{
|
{
|
||||||
struct evcell *evrem;
|
struct evcell *evrem;
|
||||||
void (*cfunc) ();
|
void (*cfunc) ();
|
||||||
int32 arg, endtime;
|
int32 arg;
|
||||||
|
uint64 endtime;
|
||||||
|
|
||||||
if (ebase.eq.nxt == NULL)
|
if (ebase.eq.nxt == NULL)
|
||||||
printf("Warning: event queue empty - power-down mode not entered\n");
|
printf("Warning: event queue empty - power-down mode not entered\n");
|
||||||
|
@ -37,8 +37,6 @@
|
|||||||
|
|
||||||
#define PSR_CWP 0x7
|
#define PSR_CWP 0x7
|
||||||
|
|
||||||
#define VAL(x) strtol(x,(char **)NULL,0)
|
|
||||||
|
|
||||||
extern struct disassemble_info dinfo;
|
extern struct disassemble_info dinfo;
|
||||||
extern struct pstate sregs;
|
extern struct pstate sregs;
|
||||||
extern struct estate ebase;
|
extern struct estate ebase;
|
||||||
@ -69,7 +67,7 @@ host_callback *sim_callback;
|
|||||||
int
|
int
|
||||||
run_sim(sregs, icount, dis)
|
run_sim(sregs, icount, dis)
|
||||||
struct pstate *sregs;
|
struct pstate *sregs;
|
||||||
unsigned int icount;
|
uint64 icount;
|
||||||
int dis;
|
int dis;
|
||||||
{
|
{
|
||||||
int mexc, irq;
|
int mexc, irq;
|
||||||
@ -234,7 +232,7 @@ sim_open (kind, callback, abfd, argv)
|
|||||||
} else
|
} else
|
||||||
if (strcmp(argv[stat], "-freq") == 0) {
|
if (strcmp(argv[stat], "-freq") == 0) {
|
||||||
if ((stat + 1) < argc) {
|
if ((stat + 1) < argc) {
|
||||||
freq = VAL(argv[++stat]);
|
freq = strtol(argv[++stat], (char **)NULL, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
(*sim_callback->printf_filtered) (sim_callback,
|
(*sim_callback->printf_filtered) (sim_callback,
|
||||||
@ -461,7 +459,7 @@ flush_windows ()
|
|||||||
void
|
void
|
||||||
sim_resume(SIM_DESC sd, int step, int siggnal)
|
sim_resume(SIM_DESC sd, int step, int siggnal)
|
||||||
{
|
{
|
||||||
simstat = run_sim(&sregs, -1, 0);
|
simstat = run_sim(&sregs, UINT64_MAX, 0);
|
||||||
|
|
||||||
if (sis_gdb_break) flush_windows ();
|
if (sis_gdb_break) flush_windows ();
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ extern int era;
|
|||||||
int
|
int
|
||||||
run_sim(sregs, icount, dis)
|
run_sim(sregs, icount, dis)
|
||||||
struct pstate *sregs;
|
struct pstate *sregs;
|
||||||
unsigned int icount;
|
uint64 icount;
|
||||||
int dis;
|
int dis;
|
||||||
{
|
{
|
||||||
int irq, mexc, deb, asi;
|
int irq, mexc, deb, asi;
|
||||||
|
@ -23,6 +23,7 @@
|
|||||||
#include "ansidecl.h"
|
#include "ansidecl.h"
|
||||||
#include "gdb/callback.h"
|
#include "gdb/callback.h"
|
||||||
#include "gdb/remote-sim.h"
|
#include "gdb/remote-sim.h"
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "end.h"
|
#include "end.h"
|
||||||
|
|
||||||
@ -52,8 +53,8 @@ typedef float float32; /* 32-bit float */
|
|||||||
typedef double float64; /* 64-bit float */
|
typedef double float64; /* 64-bit float */
|
||||||
|
|
||||||
/* FIXME: what about host compilers that don't support 64-bit ints? */
|
/* FIXME: what about host compilers that don't support 64-bit ints? */
|
||||||
typedef unsigned long long uint64; /* 64-bit unsigned int */
|
typedef uint64_t uint64; /* 64-bit unsigned int */
|
||||||
typedef long long int64; /* 64-bit signed int */
|
typedef int64_t int64; /* 64-bit signed int */
|
||||||
|
|
||||||
struct pstate {
|
struct pstate {
|
||||||
|
|
||||||
@ -108,22 +109,22 @@ struct pstate {
|
|||||||
float32 freq; /* Simulated processor frequency */
|
float32 freq; /* Simulated processor frequency */
|
||||||
|
|
||||||
|
|
||||||
uint32 tottime;
|
uint64 tottime;
|
||||||
uint32 ninst;
|
uint64 ninst;
|
||||||
uint32 fholdt;
|
uint64 fholdt;
|
||||||
uint32 holdt;
|
uint64 holdt;
|
||||||
uint32 icntt;
|
uint64 icntt;
|
||||||
uint32 finst;
|
uint64 finst;
|
||||||
uint32 simstart;
|
uint64 simstart;
|
||||||
uint32 starttime;
|
uint64 starttime;
|
||||||
uint32 tlimit; /* Simulation time limit */
|
uint64 tlimit; /* Simulation time limit */
|
||||||
uint32 pwdtime; /* Cycles in power-down mode */
|
uint64 pwdtime; /* Cycles in power-down mode */
|
||||||
uint32 nstore; /* Number of load instructions */
|
uint64 nstore; /* Number of load instructions */
|
||||||
uint32 nload; /* Number of store instructions */
|
uint64 nload; /* Number of store instructions */
|
||||||
uint32 nannul; /* Number of annuled instructions */
|
uint64 nannul; /* Number of annuled instructions */
|
||||||
uint32 nbranch; /* Number of branch instructions */
|
uint64 nbranch; /* Number of branch instructions */
|
||||||
uint32 ildreg; /* Destination of last load instruction */
|
uint32 ildreg; /* Destination of last load instruction */
|
||||||
uint32 ildtime; /* Last time point for load dependency */
|
uint64 ildtime; /* Last time point for load dependency */
|
||||||
|
|
||||||
int rett_err; /* IU in jmpl/restore error state (Rev.0) */
|
int rett_err; /* IU in jmpl/restore error state (Rev.0) */
|
||||||
int jmpltime;
|
int jmpltime;
|
||||||
@ -132,14 +133,14 @@ struct pstate {
|
|||||||
struct evcell {
|
struct evcell {
|
||||||
void (*cfunc) ();
|
void (*cfunc) ();
|
||||||
int32 arg;
|
int32 arg;
|
||||||
uint32 time;
|
uint64 time;
|
||||||
struct evcell *nxt;
|
struct evcell *nxt;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct estate {
|
struct estate {
|
||||||
struct evcell eq;
|
struct evcell eq;
|
||||||
struct evcell *freeq;
|
struct evcell *freeq;
|
||||||
uint32 simtime;
|
uint64 simtime;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct irqcell {
|
struct irqcell {
|
||||||
@ -168,8 +169,8 @@ extern int memory_read PARAMS ((int32 asi, uint32 addr, uint32 *data,
|
|||||||
int32 sz, int32 *ws));
|
int32 sz, int32 *ws));
|
||||||
extern int memory_write PARAMS ((int32 asi, uint32 addr, uint32 *data,
|
extern int memory_write PARAMS ((int32 asi, uint32 addr, uint32 *data,
|
||||||
int32 sz, int32 *ws));
|
int32 sz, int32 *ws));
|
||||||
extern int sis_memory_write PARAMS ((uint32 addr, char *data,
|
extern int sis_memory_write PARAMS ((uint32 addr,
|
||||||
uint32 length));
|
const unsigned char *data, uint32 length));
|
||||||
extern int sis_memory_read PARAMS ((uint32 addr, char *data,
|
extern int sis_memory_read PARAMS ((uint32 addr, char *data,
|
||||||
uint32 length));
|
uint32 length));
|
||||||
|
|
||||||
@ -186,7 +187,7 @@ extern void init_signals PARAMS ((void));
|
|||||||
struct disassemble_info;
|
struct disassemble_info;
|
||||||
extern void dis_mem PARAMS ((uint32 addr, uint32 len,
|
extern void dis_mem PARAMS ((uint32 addr, uint32 len,
|
||||||
struct disassemble_info *info));
|
struct disassemble_info *info));
|
||||||
extern void event PARAMS ((void (*cfunc) (), int32 arg, uint32 delta));
|
extern void event PARAMS ((void (*cfunc) (), int32 arg, uint64 delta));
|
||||||
extern void set_int PARAMS ((int32 level, void (*callback) (), int32 arg));
|
extern void set_int PARAMS ((int32 level, void (*callback) (), int32 arg));
|
||||||
extern void advance_time PARAMS ((struct pstate *sregs));
|
extern void advance_time PARAMS ((struct pstate *sregs));
|
||||||
extern uint32 now PARAMS ((void));
|
extern uint32 now PARAMS ((void));
|
||||||
@ -205,7 +206,7 @@ extern void init_regs PARAMS ((struct pstate *sregs));
|
|||||||
|
|
||||||
/* interf.c */
|
/* interf.c */
|
||||||
extern int run_sim PARAMS ((struct pstate *sregs,
|
extern int run_sim PARAMS ((struct pstate *sregs,
|
||||||
unsigned int icount, int dis));
|
uint64 icount, int dis));
|
||||||
|
|
||||||
/* float.c */
|
/* float.c */
|
||||||
extern int get_accex PARAMS ((void));
|
extern int get_accex PARAMS ((void));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user