@@ -27,15 +27,11 @@
typedef struct MonitorDef MonitorDef;
-#ifdef COMPILING_PER_TARGET
-#include "exec/target_long.h"
struct MonitorDef {
const char *name;
int offset;
- target_long (*get_value)(Monitor *mon, const struct MonitorDef *md,
- int val);
+ int64_t (*get_value)(Monitor *mon, const MonitorDef *md, int offset);
};
-#endif
const MonitorDef *target_monitor_defs(void);
@@ -593,11 +593,16 @@ void hmp_mce(Monitor *mon, const QDict *qdict)
}
}
-static target_long monitor_get_pc(Monitor *mon, const struct MonitorDef *md,
- int val)
+static int64_t monitor_get_pc(Monitor *mon, const struct MonitorDef *md,
+ int offset)
{
CPUArchState *env = mon_get_cpu_env(mon);
- return env->eip + env->segs[R_CS].base;
+ int64_t ret = env->eip + env->segs[R_CS].base;
+
+ if (!(env->hflags & HF_CS64_MASK)) {
+ ret = (int32_t)ret;
+ }
+ return ret;
}
const MonitorDef monitor_defs[] = {