qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Thomas Huth <thuth@redhat.com>,
	qemu-devel@nongnu.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>
Cc: qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] target/cris/translate: Get rid of qemu_log_separate()
Date: Tue, 9 Oct 2018 09:55:19 +0200	[thread overview]
Message-ID: <f8c0f859-2d70-b53e-a39a-48c2bf253be6@redhat.com> (raw)
In-Reply-To: <1539071180-2028-1-git-send-email-thuth@redhat.com>

Hi Thomas,

On 09/10/2018 09:46, Thomas Huth wrote:
> The gen_BUG() function calls already cpu_abort(), which prints the
> information to stderr and the log already. So instead of additionally
> printing the dc->pc via fprintf() and qemu_log here, too, we can
> simply pass this information to cpu_abort() instead.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  target/cris/translate.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/target/cris/translate.c b/target/cris/translate.c
> index 4ae1c04..0ee2c5d 100644
> --- a/target/cris/translate.c
> +++ b/target/cris/translate.c
> @@ -137,11 +137,7 @@ typedef struct DisasContext {
>  
>  static void gen_BUG(DisasContext *dc, const char *file, int line)
>  {
> -    fprintf(stderr, "BUG: pc=%x %s %d\n", dc->pc, file, line);
> -    if (qemu_log_separate()) {
> -        qemu_log("BUG: pc=%x %s %d\n", dc->pc, file, line);
> -    }
> -    cpu_abort(CPU(dc->cpu), "%s:%d\n", file, line);
> +    cpu_abort(CPU(dc->cpu), "%s:%d dc->pc=%x\n", file, line, dc->pc);

I'd use a simpler format (why display internal "dc->"?):

       cpu_abort(CPU(dc->cpu), "%s:%d BUG: pc=%x\n", ...


>  }
>  
>  static const char *regnames_v32[] =
> 

  reply	other threads:[~2018-10-09  7:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-09  7:46 [Qemu-devel] [PATCH] target/cris/translate: Get rid of qemu_log_separate() Thomas Huth
2018-10-09  7:55 ` Philippe Mathieu-Daudé [this message]
2018-10-10  7:06   ` [Qemu-devel] [PATCH v2] " Thomas Huth
2018-10-10  9:04     ` Philippe Mathieu-Daudé

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=f8c0f859-2d70-b53e-a39a-48c2bf253be6@redhat.com \
    --to=philmd@redhat.com \
    --cc=edgar.iglesias@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=thuth@redhat.com \
    /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).