qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] plugins/execlog.c: correct dump of registers values
@ 2024-06-20  8:38 Frédéric Pétrot
  2024-06-20 18:38 ` Pierrick Bouvier
  2024-07-17 18:09 ` Alex Bennée
  0 siblings, 2 replies; 3+ messages in thread
From: Frédéric Pétrot @ 2024-06-20  8:38 UTC (permalink / raw)
  To: alex.bennee, erdnaxe, ma.mandourr, pierrick.bouvier
  Cc: qemu-devel, Frédéric Pétrot

Register values are dumped as 'sz' chunks of two nibbles in the execlog
plugin, sz was 1 too big.

Signed-off-by: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
---
 contrib/plugins/execlog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c
index 371db97eb1..1c1601cc0b 100644
--- a/contrib/plugins/execlog.c
+++ b/contrib/plugins/execlog.c
@@ -101,7 +101,7 @@ static void insn_check_regs(CPU *cpu)
             GByteArray *temp = reg->last;
             g_string_append_printf(cpu->last_exec, ", %s -> 0x", reg->name);
             /* TODO: handle BE properly */
-            for (int i = sz; i >= 0; i--) {
+            for (int i = sz - 1; i >= 0; i--) {
                 g_string_append_printf(cpu->last_exec, "%02x",
                                        reg->new->data[i]);
             }
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] plugins/execlog.c: correct dump of registers values
  2024-06-20  8:38 [PATCH] plugins/execlog.c: correct dump of registers values Frédéric Pétrot
@ 2024-06-20 18:38 ` Pierrick Bouvier
  2024-07-17 18:09 ` Alex Bennée
  1 sibling, 0 replies; 3+ messages in thread
From: Pierrick Bouvier @ 2024-06-20 18:38 UTC (permalink / raw)
  To: Frédéric Pétrot, alex.bennee, erdnaxe, ma.mandourr
  Cc: qemu-devel

On 6/20/24 01:38, Frédéric Pétrot wrote:
> Register values are dumped as 'sz' chunks of two nibbles in the execlog
> plugin, sz was 1 too big.
> 
> Signed-off-by: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
> ---
>   contrib/plugins/execlog.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/contrib/plugins/execlog.c b/contrib/plugins/execlog.c
> index 371db97eb1..1c1601cc0b 100644
> --- a/contrib/plugins/execlog.c
> +++ b/contrib/plugins/execlog.c
> @@ -101,7 +101,7 @@ static void insn_check_regs(CPU *cpu)
>               GByteArray *temp = reg->last;
>               g_string_append_printf(cpu->last_exec, ", %s -> 0x", reg->name);
>               /* TODO: handle BE properly */
> -            for (int i = sz; i >= 0; i--) {
> +            for (int i = sz - 1; i >= 0; i--) {
>                   g_string_append_printf(cpu->last_exec, "%02x",
>                                          reg->new->data[i]);
>               }

Good catch, thanks!
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>

Pierrick

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] plugins/execlog.c: correct dump of registers values
  2024-06-20  8:38 [PATCH] plugins/execlog.c: correct dump of registers values Frédéric Pétrot
  2024-06-20 18:38 ` Pierrick Bouvier
@ 2024-07-17 18:09 ` Alex Bennée
  1 sibling, 0 replies; 3+ messages in thread
From: Alex Bennée @ 2024-07-17 18:09 UTC (permalink / raw)
  To: Frédéric Pétrot
  Cc: erdnaxe, ma.mandourr, pierrick.bouvier, qemu-devel

Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr> writes:

> Register values are dumped as 'sz' chunks of two nibbles in the execlog
> plugin, sz was 1 too big.
>
> Signed-off-by: Frédéric Pétrot
> <frederic.petrot@univ-grenoble-alpes.fr>

Queued to plugins/next, thanks.

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-07-17 18:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-20  8:38 [PATCH] plugins/execlog.c: correct dump of registers values Frédéric Pétrot
2024-06-20 18:38 ` Pierrick Bouvier
2024-07-17 18:09 ` Alex Bennée

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).