Line 81... |
Line 81... |
argaddr = 3;
|
argaddr = 3;
|
#endif
|
#endif
|
tee_exe_log = (config.sim.exe_log && (config.sim.exe_log_type == EXE_LOG_SOFTWARE || config.sim.exe_log_type == EXE_LOG_SIMPLE)
|
tee_exe_log = (config.sim.exe_log && (config.sim.exe_log_type == EXE_LOG_SOFTWARE || config.sim.exe_log_type == EXE_LOG_SIMPLE)
|
&& config.sim.exe_log_start <= runtime.cpu.instructions && (config.sim.exe_log_end <= 0 || runtime.cpu.instructions <= config.sim.exe_log_end));
|
&& config.sim.exe_log_start <= runtime.cpu.instructions && (config.sim.exe_log_end <= 0 || runtime.cpu.instructions <= config.sim.exe_log_end));
|
|
|
if (tee_exe_log)
|
if (tee_exe_log) fprintf (runtime.sim.fexe_log, "SIMPRINTF: ");
|
fprintf (runtime.sim.fexe_log, "SIMPRINTF: ");
|
|
debug(6, "simprintf: %s\n", fmtstrpart);
|
debug(6, "simprintf: %s\n", fmtstrpart);
|
while(strlen(fmtstrpart)) {
|
while(strlen(fmtstrpart)) {
|
debug(6, "simprintf(): 1");
|
debug(6, "simprintf(): 1");
|
if ((fmtstrend = strstr(fmtstrpart + 1, "%")))
|
if ((fmtstrend = strstr(fmtstrpart + 1, "%")))
|
*fmtstrend = '\0';
|
*fmtstrend = '\0';
|
debug(6," 2");
|
debug(6," 2");
|
if (strstr(fmtstrpart, "%")) {
|
if (strstr(fmtstrpart, "%")) {
|
|
char *tmp;
|
|
int string = 0;
|
debug(6, " 3");
|
debug(6, " 3");
|
#if STACK_ARGS
|
#if STACK_ARGS
|
arg = eval_mem32(argaddr,&breakpoint);
|
arg = eval_mem32(argaddr,&breakpoint);
|
argaddr += 4;
|
argaddr += 4;
|
#else
|
#else
|
sprintf(regstr, "r%u", ++argaddr);
|
sprintf(regstr, "r%u", ++argaddr);
|
arg = evalsim_reg32(atoi(regstr));
|
arg = evalsim_reg32(atoi(regstr));
|
#endif
|
#endif
|
debug(6, " 4: fmtstrpart=%p fmtstrpart=%s arg=%p\n", fmtstrpart, fmtstrpart, arg);
|
debug(6, " 4: fmtstrpart=%p fmtstrpart=%s arg=%p\n", fmtstrpart, fmtstrpart, arg);
|
if (strncmp(fmtstrpart, "%s", 2) == 0) {
|
tmp = fmtstrpart;
|
|
if (*tmp == '%') {
|
|
tmp++;
|
|
while (*tmp == '-' || *tmp >= '0' && *tmp <= '9') tmp++;
|
|
if (*tmp == 's') string = 1;
|
|
}
|
|
if (string) {
|
int len = 0;
|
int len = 0;
|
char *str;
|
char *str;
|
for(; eval_mem8(arg++,&breakpoint); len++);
|
for(; eval_mem8(arg++,&breakpoint); len++);
|
len++; /* for null char */
|
len++; /* for null char */
|
arg -= len;
|
arg -= len;
|