qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Ján Tomko" <jtomko@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>,
	Eric Blake <eblake@redhat.com>,
	qemu-devel@nongnu.org,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Eduardo Habkost <ehabkost@redhat.com>
Subject: Re: [PATCH 3/5] target/i386: convert to use format_state instead of dump_state
Date: Wed, 8 Sep 2021 14:17:57 +0200	[thread overview]
Message-ID: <YTip9eS5bip7Q3Ui@fedora> (raw)
In-Reply-To: <20210908103711.683940-4-berrange@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2302 bytes --]

On a Wednesday in 2021, Daniel P. Berrangé wrote:
>Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
>---
> target/i386/cpu-dump.c | 325 ++++++++++++++++++++++-------------------
> target/i386/cpu.c      |   2 +-
> target/i386/cpu.h      |   2 +-
> 3 files changed, 174 insertions(+), 155 deletions(-)
>
>diff --git a/target/i386/cpu-dump.c b/target/i386/cpu-dump.c
>index 02b635a52c..8e19485a20 100644
>--- a/target/i386/cpu-dump.c
>+++ b/target/i386/cpu-dump.c

[...]

>@@ -355,107 +359,116 @@ void x86_cpu_dump_state(CPUState *cs, FILE *f, int flags)

[...]

>     {
>-        qemu_fprintf(f, "GDT=     %08x %08x\n",
>-                     (uint32_t)env->gdt.base, env->gdt.limit);
>-        qemu_fprintf(f, "IDT=     %08x %08x\n",
>-                     (uint32_t)env->idt.base, env->idt.limit);
>-        qemu_fprintf(f, "CR0=%08x CR2=%08x CR3=%08x CR4=%08x\n",
>-                     (uint32_t)env->cr[0],
>-                     (uint32_t)env->cr[2],
>-                     (uint32_t)env->cr[3],
>-                     (uint32_t)env->cr[4]);
>+        g_string_append_printf(buf, "GDT=     %08x %08x\n",
>+                               (uint32_t)env->gdt.base, env->gdt.limit);
>+        g_string_append_printf(buf, "IDT=     %08x %08x\n",
>+                               (uint32_t)env->idt.base, env->idt.limit);
>+        g_string_append_printf(buf, "CR0=%08x CR2=%08x CR3=%08x CR4=%08x\n",
>+                               (uint32_t)env->cr[0],
>+                               (uint32_t)env->cr[2],
>+                               (uint32_t)env->cr[3],
>+                               (uint32_t)env->cr[4]);
>         for(i = 0; i < 4; i++) {
>-            qemu_fprintf(f, "DR%d=" TARGET_FMT_lx " ", i, env->dr[i]);
>+            g_string_append_printf(buf, "DR%d=" TARGET_FMT_lx
>+                                   " ", i, env->dr[i]);

The formatting string can comfortably fit on the first line here.

Jano

>         }
>-        qemu_fprintf(f, "\nDR6=" TARGET_FMT_lx " DR7=" TARGET_FMT_lx "\n",
>-                     env->dr[6], env->dr[7]);
>+        g_string_append_printf(buf, "\nDR6=" TARGET_FMT_lx
>+                               " DR7=" TARGET_FMT_lx "\n",
>+                               env->dr[6], env->dr[7]);

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-09-08 12:21 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-08 10:37 [PATCH 0/5] Stop adding HMP-only commands, allow QMP for all Daniel P. Berrangé
2021-09-08 10:37 ` [PATCH 1/5] docs/devel: document expectations for QAPI data modelling for QMP Daniel P. Berrangé
2021-09-08 17:42   ` Eric Blake
2021-09-09  9:33   ` Markus Armbruster
2021-09-10 12:46     ` Daniel P. Berrangé
2021-09-10 13:45       ` Markus Armbruster
2021-09-10 13:52         ` Daniel P. Berrangé
2021-09-08 10:37 ` [PATCH 2/5] hw/core: introduce 'format_state' callback to replace 'dump_state' Daniel P. Berrangé
2021-09-08 10:37 ` [PATCH 3/5] target/i386: convert to use format_state instead of dump_state Daniel P. Berrangé
2021-09-08 12:17   ` Ján Tomko [this message]
2021-09-08 18:05   ` Eric Blake
2021-09-08 22:06     ` Daniel P. Berrangé
2021-09-09  9:55       ` Daniel P. Berrangé
2021-09-08 10:37 ` [PATCH 4/5] qapi: introduce x-query-registers QMP command Daniel P. Berrangé
2021-09-08 18:06   ` Eric Blake
2021-09-09  9:05   ` Markus Armbruster
2021-09-09 10:01     ` Daniel P. Berrangé
2021-09-08 10:37 ` [PATCH 5/5] monitor: rewrite 'info registers' in terms of 'x-query-registers' Daniel P. Berrangé
2021-09-08 11:01   ` Philippe Mathieu-Daudé
2021-09-08 11:02     ` Daniel P. Berrangé
2021-09-08 12:18 ` [PATCH 0/5] Stop adding HMP-only commands, allow QMP for all Ján Tomko
2021-09-08 15:09 ` Markus Armbruster
2021-09-08 15:24   ` Daniel P. Berrangé
2021-09-09  4:48     ` Markus Armbruster
2021-09-09  8:13       ` Markus Armbruster
2021-09-09  8:40       ` Daniel P. Berrangé
2021-09-08 16:15   ` Philippe Mathieu-Daudé
2021-09-09  6:15   ` Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YTip9eS5bip7Q3Ui@fedora \
    --to=jtomko@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).