qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Aurelien Jarno <aurelien@aurel32.net>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [5945] target-alpha: gdb-stub support
Date: Sun, 07 Dec 2008 23:26:32 +0000	[thread overview]
Message-ID: <E1L9T1E-0001lC-VX@cvs.savannah.gnu.org> (raw)

Revision: 5945
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=5945
Author:   aurel32
Date:     2008-12-07 23:26:32 +0000 (Sun, 07 Dec 2008)

Log Message:
-----------
target-alpha: gdb-stub support

(Vince Weaver)

Modified Paths:
--------------
    trunk/gdbstub.c
    trunk/target-alpha/translate.c

Modified: trunk/gdbstub.c
===================================================================
--- trunk/gdbstub.c	2008-12-07 23:26:24 UTC (rev 5944)
+++ trunk/gdbstub.c	2008-12-07 23:26:32 UTC (rev 5945)
@@ -990,6 +990,56 @@
 
     return 4;
 }
+#elif defined (TARGET_ALPHA)
+
+#define NUM_CORE_REGS 65
+
+static int cpu_gdb_read_register(CPUState *env, uint8_t *mem_buf, int n)
+{
+    if (n < 31) {
+       GET_REGL(env->ir[n]);
+    }
+    else if (n == 31) {
+       GET_REGL(0);
+    }
+    else if (n<63) {
+       uint64_t val;
+
+       val=*((uint64_t *)&env->fir[n-32]);
+       GET_REGL(val);
+    }
+    else if (n==63) {
+       GET_REGL(env->fpcr);
+    }
+    else if (n==64) {
+       GET_REGL(env->pc);
+    }
+    else {
+       GET_REGL(0);
+    }
+
+    return 0;
+}
+
+static int cpu_gdb_write_register(CPUState *env, uint8_t *mem_buf, int n)
+{
+    target_ulong tmp;
+    tmp = ldtul_p(mem_buf);
+
+    if (n < 31) {
+        env->ir[n] = tmp;
+    }
+
+    if (n > 31 && n < 63) {
+        env->fir[n - 32] = ldfl_p(mem_buf);
+    }
+
+    if (n == 64 ) {
+       env->pc=tmp;
+    }
+
+    return 8;
+}
 #else
 
 #define NUM_CORE_REGS 0
@@ -1277,6 +1327,8 @@
             s->c_cpu->active_tc.PC = addr;
 #elif defined (TARGET_CRIS)
             s->c_cpu->pc = addr;
+#elif defined (TARGET_ALPHA)
+            s->c_cpu->pc = addr;
 #endif
         }
         gdb_continue(s);
@@ -1313,6 +1365,8 @@
             s->c_cpu->active_tc.PC = addr;
 #elif defined (TARGET_CRIS)
             s->c_cpu->pc = addr;
+#elif defined (TARGET_ALPHA)
+            s->c_cpu->pc = addr;
 #endif
         }
         cpu_single_step(s->c_cpu, sstep_flags);

Modified: trunk/target-alpha/translate.c
===================================================================
--- trunk/target-alpha/translate.c	2008-12-07 23:26:24 UTC (rev 5944)
+++ trunk/target-alpha/translate.c	2008-12-07 23:26:32 UTC (rev 5945)
@@ -2407,10 +2407,15 @@
          * generation
          */
         if (((ctx.pc & (TARGET_PAGE_SIZE - 1)) == 0) ||
-            (env->singlestep_enabled) ||
             num_insns >= max_insns) {
             break;
         }
+
+        if (env->singlestep_enabled) {
+            gen_excp(&ctx, EXCP_DEBUG, 0);
+            break;
+	}
+
 #if defined (DO_SINGLE_STEP)
         break;
 #endif

                 reply	other threads:[~2008-12-07 23:26 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=E1L9T1E-0001lC-VX@cvs.savannah.gnu.org \
    --to=aurelien@aurel32.net \
    --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).