On 29/1/26 16:06, BALATON Zoltan wrote:
On Thu, 29 Jan 2026, Philippe Mathieu-Daudé wrote:
Rather than truncating with a target_long cast, use the
unaligned load/store API.
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
include/monitor/hmp-target.h | 3 ---
monitor/hmp-target.c | 8 +++++---
2 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/monitor/hmp-target.c b/monitor/hmp-target.c
index 5738b47bb03..257605a1c96 100644
--- a/monitor/hmp-target.c
+++ b/monitor/hmp-target.c
@@ -23,6 +23,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/bswap.h"
#include "monitor-internal.h"
#include "monitor/qdev.h"
#include "net/slirp.h"
@@ -65,6 +66,7 @@ HMPCommand *hmp_cmds_for_target(bool info_command)
*/
int get_monitor_def(Monitor *mon, uint64_t *pval, const char *name)
{
+ const unsigned length = target_long_bits() / 8;
const MonitorDef *md = target_monitor_defs();
CPUState *cs = mon_get_cpu(mon);
uint64_t tmp = 0;
@@ -83,11 +85,11 @@ int get_monitor_def(Monitor *mon, uint64_t *pval,
const char *name)
void *ptr = (uint8_t *)env + md->offset;
switch(md->type) {
- case MD_U32:
+ case MD_I32:
Why is this changed? Doesn't seem to be realted to what the commit
message says.
Good catch! This is due to a broken rebase I suppose. The change is
explained in patch #5 "monitor: Have MonitorDef::get_value() return
an unsigned type".
I'll clean that up and respin.