]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/alpha: Document gdbstub register indexes
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 17 Feb 2026 07:29:04 +0000 (08:29 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Wed, 25 Feb 2026 22:46:04 +0000 (23:46 +0100)
Follow GDB XML comments. Re-order switch cases for clarity.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-ID: <20260219191955.83815-6-philmd@linaro.org>

target/alpha/gdbstub.c

index a7110e8d1eb6e1bebb48a582ad5f8b895fcc7864..7722eb4680692510515f7e47cd1d98c969df4558 100644 (file)
@@ -31,6 +31,9 @@ int alpha_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
     case 0 ... 30:
         val = cpu_alpha_load_gr(env, n);
         break;
+    case 31: /* zero register */
+        val = 0;
+        break;
     case 32 ... 62:
         d.d = env->fir[n - 32];
         val = d.ll;
@@ -41,15 +44,12 @@ int alpha_cpu_gdb_read_register(CPUState *cs, GByteArray *mem_buf, int n)
     case 64:
         val = env->pc;
         break;
-    case 66:
-        val = env->unique;
-        break;
-    case 31:
-    case 65:
-        /* 31 really is the zero register; 65 is unassigned in the
-           gdb protocol, but is still required to occupy 8 bytes. */
+    case 65: /* former Virtual Register (reserved as unassigned) */
         val = 0;
         break;
+    case 66: /* PALcode Memory Slot */
+        val = env->unique;
+        break;
     default:
         return 0;
     }
@@ -66,6 +66,8 @@ int alpha_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
     case 0 ... 30:
         cpu_alpha_store_gr(env, n, tmp);
         break;
+    case 31: /* zero register */
+        break;
     case 32 ... 62:
         d.ll = tmp;
         env->fir[n - 32] = d.d;
@@ -76,13 +78,10 @@ int alpha_cpu_gdb_write_register(CPUState *cs, uint8_t *mem_buf, int n)
     case 64:
         env->pc = tmp;
         break;
-    case 66:
-        env->unique = tmp;
+    case 65: /* former Virtual Register (reserved as unassigned) */
         break;
-    case 31:
-    case 65:
-        /* 31 really is the zero register; 65 is unassigned in the
-           gdb protocol, but is still required to occupy 8 bytes. */
+    case 66: /* PALcode Memory Slot */
+        env->unique = tmp;
         break;
     default:
         return 0;