more register values in monitor

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@751 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
bellard 2004-04-25 18:54:52 +00:00
parent 4c27ba27c5
commit 57206fd42a
1 changed files with 22 additions and 2 deletions

View File

@ -539,6 +539,13 @@ typedef struct MonitorDef {
int (*get_value)(struct MonitorDef *md);
} MonitorDef;
#if defined(TARGET_I386)
static int monitor_get_pc (struct MonitorDef *md)
{
return cpu_single_env->eip + (long)cpu_single_env->segs[R_CS].base;
}
#endif
#if defined(TARGET_PPC)
static int monitor_get_ccr (struct MonitorDef *md)
{
@ -582,6 +589,12 @@ static int monitor_get_xer (struct MonitorDef *md)
static MonitorDef monitor_defs[] = {
#ifdef TARGET_I386
#define SEG(name, seg) \
{ name, offsetof(CPUState, segs[seg].selector) },\
{ name ".base", offsetof(CPUState, segs[seg].base) },\
{ name ".limit", offsetof(CPUState, segs[seg].limit) },
{ "eax", offsetof(CPUState, regs[0]) },
{ "ecx", offsetof(CPUState, regs[1]) },
{ "edx", offsetof(CPUState, regs[2]) },
@ -591,7 +604,13 @@ static MonitorDef monitor_defs[] = {
{ "esi", offsetof(CPUState, regs[6]) },
{ "esi", offsetof(CPUState, regs[7]) },
{ "eflags", offsetof(CPUState, eflags) },
{ "eip|pc", offsetof(CPUState, eip) },
{ "eip", offsetof(CPUState, eip) },
SEG("cs", R_CS)
SEG("ds", R_DS)
SEG("es", R_ES)
SEG("fs", R_FS)
SEG("gs", R_GS)
{ "pc", 0, monitor_get_pc, },
#elif defined(TARGET_PPC)
{ "r0", offsetof(CPUState, gpr[0]) },
{ "r1", offsetof(CPUState, gpr[1]) },
@ -625,6 +644,7 @@ static MonitorDef monitor_defs[] = {
{ "r29", offsetof(CPUState, gpr[29]) },
{ "r30", offsetof(CPUState, gpr[30]) },
{ "r31", offsetof(CPUState, gpr[31]) },
{ "nip|pc", offsetof(CPUState, nip) },
{ "lr", offsetof(CPUState, lr) },
{ "ctr", offsetof(CPUState, ctr) },
{ "decr", offsetof(CPUState, decr) },
@ -724,7 +744,7 @@ static int expr_unary(void)
while ((*pch >= 'a' && *pch <= 'z') ||
(*pch >= 'A' && *pch <= 'Z') ||
(*pch >= '0' && *pch <= '9') ||
*pch == '_') {
*pch == '_' || *pch == '.') {
if ((q - buf) < sizeof(buf) - 1)
*q++ = *pch;
pch++;