{
CPUState *env;
env = mon_get_cpu();
- if (!env)
- return;
#ifdef TARGET_I386
cpu_dump_state(env, (FILE *)mon, monitor_fprintf,
X86_DUMP_FPU);
int flags;
flags = 0;
env = mon_get_cpu();
- if (!env && !is_physical)
+ if (!is_physical)
return;
#ifdef TARGET_I386
if (wsize == 2) {
cpu_physical_memory_rw(addr, buf, l, 0);
} else {
env = mon_get_cpu();
- if (!env)
- break;
if (cpu_memory_rw_debug(env, addr, buf, l, 0) < 0) {
monitor_printf(mon, " Cannot access memory\n");
break;
uint8_t buf[1024];
env = mon_get_cpu();
- if (!env)
- return;
f = fopen(filename, "wb");
if (!f) {
uint32_t pgd, pde, pte;
env = mon_get_cpu();
- if (!env)
- return;
if (!(env->cr[0] & CR0_PG_MASK)) {
monitor_printf(mon, "PG disabled\n");
uint32_t pgd, pde, pte, start, end;
env = mon_get_cpu();
- if (!env)
- return;
if (!(env->cr[0] & CR0_PG_MASK)) {
monitor_printf(mon, "PG disabled\n");
static target_long monitor_get_pc (const struct MonitorDef *md, int val)
{
CPUState *env = mon_get_cpu();
- if (!env)
- return 0;
return env->eip + env->segs[R_CS].base;
}
#endif
unsigned int u;
int i;
- if (!env)
- return 0;
-
u = 0;
for (i = 0; i < 8; i++)
u |= env->crf[i] << (32 - (4 * i));
static target_long monitor_get_msr (const struct MonitorDef *md, int val)
{
CPUState *env = mon_get_cpu();
- if (!env)
- return 0;
return env->msr;
}
static target_long monitor_get_xer (const struct MonitorDef *md, int val)
{
CPUState *env = mon_get_cpu();
- if (!env)
- return 0;
return env->xer;
}
static target_long monitor_get_decr (const struct MonitorDef *md, int val)
{
CPUState *env = mon_get_cpu();
- if (!env)
- return 0;
return cpu_ppc_load_decr(env);
}
static target_long monitor_get_tbu (const struct MonitorDef *md, int val)
{
CPUState *env = mon_get_cpu();
- if (!env)
- return 0;
return cpu_ppc_load_tbu(env);
}
static target_long monitor_get_tbl (const struct MonitorDef *md, int val)
{
CPUState *env = mon_get_cpu();
- if (!env)
- return 0;
return cpu_ppc_load_tbl(env);
}
#endif
static target_long monitor_get_psr (const struct MonitorDef *md, int val)
{
CPUState *env = mon_get_cpu();
- if (!env)
- return 0;
return GET_PSR(env);
}
#endif
static target_long monitor_get_reg(const struct MonitorDef *md, int val)
{
CPUState *env = mon_get_cpu();
- if (!env)
- return 0;
return env->regwptr[val];
}
#endif
longjmp(expr_env, 1);
}
-/* return 0 if OK, -1 if not found, -2 if no CPU defined */
+/* return 0 if OK, -1 if not found */
static int get_monitor_def(target_long *pval, const char *name)
{
const MonitorDef *md;
*pval = md->get_value(md, md->offset);
} else {
CPUState *env = mon_get_cpu();
- if (!env)
- return -2;
ptr = (uint8_t *)env + md->offset;
switch(md->type) {
case MD_I32:
pch++;
*q = 0;
ret = get_monitor_def(®, buf);
- if (ret == -1)
+ if (ret < 0)
expr_error(mon, "unknown register");
- else if (ret == -2)
- expr_error(mon, "no cpu defined");
n = reg;
}
break;