public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org>
To: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] align gdbstub with QEMU
Date: Thu, 20 Dec 2007 15:57:25 +0100	[thread overview]
Message-ID: <476A82D5.8040306@siemens.com> (raw)
In-Reply-To: <476290CA.2040001-atKUWr5tajBWk0Htik3J/w@public.gmane.org>

Avi Kivity wrote:
> Jan Kiszka wrote:
>> Jan Kiszka wrote:
>>  
>>> We've noticed some problems with current gdbstub in kvm's qemu:
>>>
>>> # qemu-system-x86_64 -hda myimage -S -s &
>>> # gdb
>>> (gdb) tar re :1234
>>> Remote debugging using :1234
>>> Remote 'g' packet reply is too long:
>>> 000000000000000000000000000000000000[...]
>>>
>>> This issue did not occur with QEMU from CVS. As I was aware of an
>>> x86_64-related problem in QEMU's gdbstub, I merged its current state
>>> into kvm - and things start to work again. Find the update patch below.
>>>     
>>
>> Any feedback on this? Any chance to see this patch (or some similar
>> version) in kvm-57?
>>
>>   
> 
> Sorry for the non-response. I am hoping to get qemu-cvs merged for
> kvm-57, which will naturally include this. If that doesn't work out
> (i.e. we discover regressions), and if this is important for you, I will
> apply the patch.

The qemu update did take place for -57, but a bit too mechanically.
Please merge this patch to finally fix the gdbstub.

Thanks,
Jan



Remove left-over from qemu CVS update.

Signed-off-by: Jan Kiszka <jan.kiszka-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org>

---
 qemu/gdbstub.c |  136 ---------------------------------------------------------
 1 file changed, 1 insertion(+), 135 deletions(-)

Index: kvm-userspace/qemu/gdbstub.c
===================================================================
--- kvm-userspace.orig/qemu/gdbstub.c
+++ kvm-userspace/qemu/gdbstub.c
@@ -225,141 +225,7 @@ static int put_packet(GDBState *s, char 
     return 0;
 }
 
-#if defined(TARGET_X86_64)
-
-static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf)
-{
-    uint8_t *p = mem_buf;
-    int i, fpus;
-
-#define PUTREG(x) do { \
-	target_ulong reg = tswapl(x); \
-	memcpy(p, &reg, sizeof reg); \
-	p += sizeof reg; \
-    } while (0)
-#define PUTREG32(x) do { \
-	uint32_t reg = tswap32(x);		\
-	memcpy(p, &reg, sizeof reg); \
-	p += sizeof reg; \
-    } while (0)
-#define PUTREGF(x) do { \
-	memcpy(p, &(x), 10);			\
-	p += sizeof (x);			\
-    } while (0)
-
-    PUTREG(env->regs[R_EAX]);
-    PUTREG(env->regs[R_EBX]);
-    PUTREG(env->regs[R_ECX]);
-    PUTREG(env->regs[R_EDX]);
-    PUTREG(env->regs[R_ESI]);
-    PUTREG(env->regs[R_EDI]);
-    PUTREG(env->regs[R_EBP]);
-    PUTREG(env->regs[R_ESP]);
-    PUTREG(env->regs[8]);
-    PUTREG(env->regs[9]);
-    PUTREG(env->regs[10]);
-    PUTREG(env->regs[11]);
-    PUTREG(env->regs[12]);
-    PUTREG(env->regs[13]);
-    PUTREG(env->regs[14]);
-    PUTREG(env->regs[15]);
-
-    PUTREG(env->eip);
-    PUTREG32(env->eflags);
-    PUTREG32(env->segs[R_CS].selector);
-    PUTREG32(env->segs[R_SS].selector);
-    PUTREG32(env->segs[R_DS].selector);
-    PUTREG32(env->segs[R_ES].selector);
-    PUTREG32(env->segs[R_FS].selector);
-    PUTREG32(env->segs[R_GS].selector);
-    /* XXX: convert floats */
-    for(i = 0; i < 8; i++) {
-        PUTREGF(env->fpregs[i]);
-    }
-    PUTREG32(env->fpuc);
-    fpus = (env->fpus & ~0x3800) | (env->fpstt & 0x7) << 11;
-    PUTREG32(fpus);
-    PUTREG32(0); /* XXX: convert tags */
-    PUTREG32(0); /* fiseg */
-    PUTREG32(0); /* fioff */
-    PUTREG32(0); /* foseg */
-    PUTREG32(0); /* fooff */
-    PUTREG32(0); /* fop */
-
-#undef PUTREG
-#undef PUTREG32
-#undef PUTREGF
-
-    return p - mem_buf;
-}
-
-static void cpu_gdb_write_registers(CPUState *env, uint8_t *mem_buf, int size)
-{
-    uint8_t *p = mem_buf;
-    uint32_t junk;
-    int i, fpus;
-
-#define GETREG(x) do { \
-	target_ulong reg; \
-    	memcpy(&reg, p, sizeof reg);     \
-	x = tswapl(reg);		 \
-	p += sizeof reg;                 \
-    } while (0)
-#define GETREG32(x) do { \
-	uint32_t reg; \
-    	memcpy(&reg, p, sizeof reg);     \
-	x = tswap32(reg);		 \
-	p += sizeof reg;                 \
-    } while (0)
-#define GETREGF(x) do { \
-    	memcpy(&(x), p, 10);		 \
-	p += 10;                         \
-    } while (0)
-
-    GETREG(env->regs[R_EAX]);
-    GETREG(env->regs[R_EBX]);
-    GETREG(env->regs[R_ECX]);
-    GETREG(env->regs[R_EDX]);
-    GETREG(env->regs[R_ESI]);
-    GETREG(env->regs[R_EDI]);
-    GETREG(env->regs[R_EBP]);
-    GETREG(env->regs[R_ESP]);
-    GETREG(env->regs[8]);
-    GETREG(env->regs[9]);
-    GETREG(env->regs[10]);
-    GETREG(env->regs[11]);
-    GETREG(env->regs[12]);
-    GETREG(env->regs[13]);
-    GETREG(env->regs[14]);
-    GETREG(env->regs[15]);
-
-    GETREG(env->eip);
-    GETREG32(env->eflags);
-    GETREG32(env->segs[R_CS].selector);
-    GETREG32(env->segs[R_SS].selector);
-    GETREG32(env->segs[R_DS].selector);
-    GETREG32(env->segs[R_ES].selector);
-    GETREG32(env->segs[R_FS].selector);
-    GETREG32(env->segs[R_GS].selector);
-    /* XXX: convert floats */
-    for(i = 0; i < 8; i++) {
-        GETREGF(env->fpregs[i]);
-    }
-    GETREG32(env->fpuc);
-    GETREG32(fpus); /* XXX: convert fpus */
-    GETREG32(junk); /* XXX: convert tags */
-    GETREG32(junk); /* fiseg */
-    GETREG32(junk); /* fioff */
-    GETREG32(junk); /* foseg */
-    GETREG32(junk); /* fooff */
-    GETREG32(junk); /* fop */
-
-#undef GETREG
-#undef GETREG32
-#undef GETREGF
-}
-
-#elif defined(TARGET_I386)
+#if defined(TARGET_I386)
 
 static int cpu_gdb_read_registers(CPUState *env, uint8_t *mem_buf)
 {

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

  parent reply	other threads:[~2007-12-20 14:57 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-07 13:24 [PATCH] align gdbstub with QEMU Jan Kiszka
     [not found] ` <47594974.4010805-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org>
2007-12-14 11:57   ` Jan Kiszka
     [not found]     ` <47626F8F.8010806-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org>
2007-12-14 14:18       ` Avi Kivity
     [not found]         ` <476290CA.2040001-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-12-14 14:27           ` Jan Kiszka
     [not found]             ` <476292CD.3020703-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org>
2007-12-14 14:31               ` Avi Kivity
2007-12-20 14:57           ` Jan Kiszka [this message]
     [not found]             ` <476A82D5.8040306-kv7WeFo6aLtBDgjK7y7TUQ@public.gmane.org>
2007-12-20 15:06               ` Avi Kivity

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=476A82D5.8040306@siemens.com \
    --to=jan.kiszka-kv7wefo6altbdgjk7y7tuq@public.gmane.org \
    --cc=avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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