qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paul Brook <paul@codesourcery.com>
To: Thiemo Seufer <ths@networkno.de>
Cc: qemu-devel@nongnu.org
Subject: [Qemu-devel] mips64 gdbstub broken
Date: Sat, 10 Nov 2007 14:53:59 +0000	[thread overview]
Message-ID: <200711101454.01251.paul@codesourcery.com> (raw)

A recent CVS commit ("Fix gdb stub for MIPS64.") looks incorrect:

> diff -u -r1.66 -r1.67
> --- gdbstub.c   8 Oct 2007 13:16:14 -0000       1.66
> +++ gdbstub.c   25 Oct 2007 21:30:37 -0000      1.67
> @@ -563,7 +563,7 @@
>          ptr += sizeof(target_ulong);
>        }
>
> -    *(target_ulong *)ptr = tswapl(env->CP0_Status);
> +    *(target_ulong *)ptr = (int32_t)tswap32(env->CP0_Status);
>      ptr += sizeof(target_ulong);

This is obviously bogus. The new value sent to gdb will depend on the host 
endianness. 

I suspect what you meant to do is

  *(target_ulong *)ptr = tswapl((int32_t)env->CP0_Status);

i.e. sign extended to a target-endian 64-bit value. This is consistent with 
the implementation of cpu_gdb_write_registers.

Could you confirm?

Paul

                 reply	other threads:[~2007-11-10 14:54 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200711101454.01251.paul@codesourcery.com \
    --to=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.org \
    --cc=ths@networkno.de \
    /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).