summaryrefslogtreecommitdiff
path: root/include/exec
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <philmd@redhat.com>2020-04-14 21:06:27 +0100
committerAlex Bennée <alex.bennee@linaro.org>2020-04-15 11:38:23 +0100
commit377f8f08bebea7cd44617b0ac0a2baf307f5f055 (patch)
treedb2279e9a4eacdb7978aa32eccbfc95df52c57ed /include/exec
parent7b8c1527ae0a9ec96a9100a05c680b55eb3aa54f (diff)
downloadqemu-377f8f08bebea7cd44617b0ac0a2baf307f5f055.zip
gdbstub: Introduce gdb_get_float32() to get 32-bit float registers
Since we now use a GByteArray, we can not use stfl_p() directly. Introduce the gdb_get_float32() helper to load a float32 register. Fixes: a010bdbe719 ("extend GByteArray to read register helpers") Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20200414163853.12164-2-philmd@redhat.com> Message-Id: <20200414200631.12799-14-alex.bennee@linaro.org>
Diffstat (limited to 'include/exec')
-rw-r--r--include/exec/gdbstub.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/exec/gdbstub.h b/include/exec/gdbstub.h
index 3c452fc50c..20e1072692 100644
--- a/include/exec/gdbstub.h
+++ b/include/exec/gdbstub.h
@@ -125,6 +125,15 @@ static inline int gdb_get_reg128(GByteArray *buf, uint64_t val_hi,
return 16;
}
+static inline int gdb_get_float32(GByteArray *array, float32 val)
+{
+ uint8_t buf[sizeof(CPU_FloatU)];
+
+ stfl_p(buf, val);
+ g_byte_array_append(array, buf, sizeof(buf));
+
+ return sizeof(buf);
+}
static inline int gdb_get_zeroes(GByteArray *array, size_t len)
{
guint oldlen = array->len;