plugins: Ensure register handles are not NULL
PATCH 1/1 plugins: Ensure register handles are not NULL
Ensure register handles are not NULL so that a plugin can assume NULL is invalid as a register handle.
Signed-off-by Akihiko Odaki <[email protected]>
--- plugins/api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
plugins/api.c +2 -2
@@ -442,7 +442,7 @@ static GArray *create_register_handles(GArray *gdbstub_regs) }/* Create a record for the plugin */ - desc.handle =GINT_TO_POINTER (grd->gdb_reg); + desc.handle =GINT_TO_POINTER (grd->gdb_reg +1 ); desc.name =g_intern_string (grd->name); desc.feature =g_intern_string (grd->feature_name);g_array_append_val (find_data, desc);
@@ -463,5 +463,5 @@ int qemu_plugin_read_register(struct qemu_plugin_register *reg, GByteArray *buf) {g_assert (current_cpu); -return gdb_read_register (current_cpu, buf,GPOINTER_TO_INT (reg)); +return gdb_read_register (current_cpu, buf,GPOINTER_TO_INT (reg) -1 ); }
---
base-commit: bfe8020c814a30479a4241aaa78b63960655962b
change-id: 20240229-null-841efa023c93
Best regards,
Signature · 1 line
Akihiko Odaki <[email protected]>
Alex Bennée
AppliedQuoted 4 lines · Akihiko Odaki
Ensure register handles are not NULL so that a plugin can assume NULL is invalid as a register handle.
Signed-off-by Akihiko Odaki <[email protected]>
Queued to plugins/next, thanks.
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro