From nobody Sat Apr 5 01:18:45 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1742408752; cv=none; d=zohomail.com; s=zohoarc; b=iXCwp5rpBGU8IyMmgl4ej8Qahc8e47OIjaBG3xrxwBPD7MYCIatE9rIpoNSGHI0C+L/aMzhSc/yEebICVr+ifm7xUgJ4+BDs0PDU8j48TUym0dIwcAZlzQpQQZdhMWRwFzNa2pGAxb82e8pYvgrLcwiiZJbWw8NIev8hhR7e+c0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742408752; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=OU7UFVG34yucEkVj19LxykWHxo5v2TaWVJvCEDbmtCg=; b=eKENMdQhMmPqj/0/3wgTHkHsO7ycoBjHEvbG1f2Y1zbVyZdBVq4Lme7NBmvWESvKIS8AxYyWZ7cgy4eVtJYUI7WtBcPNEOSIpW3Yw55ECrubaJ6toKb5jmHEBicigMebhFD6PqvkHYhGGgE8idiupWcKHtyJ6oiM/1Pps24CBqM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1742408752095116.02659984729632; Wed, 19 Mar 2025 11:25:52 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tuy5H-0001vQ-AU; Wed, 19 Mar 2025 14:24:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tuy4Q-0000PY-Uv for qemu-devel@nongnu.org; Wed, 19 Mar 2025 14:23:15 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tuy4G-0006QB-RE for qemu-devel@nongnu.org; Wed, 19 Mar 2025 14:23:14 -0400 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-3913fdd003bso633842f8f.1 for ; Wed, 19 Mar 2025 11:23:04 -0700 (PDT) Received: from draig.lan ([185.126.160.109]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-43d43f47c60sm25386695e9.13.2025.03.19.11.22.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Mar 2025 11:22:58 -0700 (PDT) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id D366860357; Wed, 19 Mar 2025 18:22:55 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1742408583; x=1743013383; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=OU7UFVG34yucEkVj19LxykWHxo5v2TaWVJvCEDbmtCg=; b=Mso5OhHx1KA0sj5ehVAX7rooa5Kvx3JcjYa8ih/PHewjY4Sm0iyQcobaVQMpMJugrD xlmL+/wRCwEcZBmdvfrmh3oyNWNXusSc4J4gYU4nIvhdOoyhGpV5D9kMxXELGlSYrnfL tbrELCk7KqMXHaiZyA+rWiGaK8GmdB++qwf9UmDJjzcfafaNDDsLJYJ/6Q98Dhkvs0/O 0OsoMmebaEqBGa5C/JWRceHP9j2qflCgxE3kvY4S0VaiNZvM326TBDjSV/kxHY2aSlft G/DIxw6LRTz75s6Mr0MyqlXiJ5h4lcDYjEaYv/dXFIe3p2pRsMykM8zs/4doAR6c3sjz XRFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1742408583; x=1743013383; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OU7UFVG34yucEkVj19LxykWHxo5v2TaWVJvCEDbmtCg=; b=hVPM2AFwHDWk0mJc1QYwxFJlFC7Pyce0B5I5xTCQ2WPIJdawtCNM0N5ITx3DaI4m/A 7PbLj5kILgz1kLg0Tm1pBP2ZQgoNwb9EcTRZ7av5k1B9NN29Xf0gbTpZ6okrCM+KxD8T GJ2uwpz01vWrERLqSL/UHX1GuLee5gw5eD9OSmXZfWBsED21yxfgfwh9tlJkJmuLuR7X x5fzQjgOg1lu9ZMnPz7w7etmfxzbUlY+ZLhCfBJVvOXIRke3qkc252ngaS4U3UI+4B1i dR54+/nGSr1jsYukoTsDB4Zaxb2fMnwAEnAVH01UyweCXoJnbeXz6WQ+fNgaKl0IIqw6 3r7w== X-Gm-Message-State: AOJu0YznpZc1ZLPsZICzrN3vBz1OPlNMHaa5qJZ5xjcvPwZ7wAYwFmpS C+T0JKSTTJMh3bkBor5rWPvxh2LCOlJ5RKnhKY0Az6mo7Qjw6JOBpSJ/WyARV+M= X-Gm-Gg: ASbGncsqxbhkg0AdmNHJuQpK54t/Ub1CJ0LlnsBg/GtmyxOsTktFjNXHIqMny39o8bb zK143LM6JgWWz6u3yFvuw9Uq9V1ePaVCsyldQ2ULoEALAbQc97k/q7hzBU2F0iUIhOJcjnb8+9E xY+gVI2r8Pb4Fd1eY1yCyahGs38AL6dkNFXesVWjoFIQbulaaN906pc2gkwvbClCwucJ/0DlYZv +AW84OkfA11uPM1KjxfVmIuzg7j7CG9e6/fTlTrvq/d6Iy3x9Zar9mQKXK8X50iOC5JzX/xfY6S lO7e/oX+rZSUbbc5NMMRSKS08PvQ+58RuzMFK35tKobQHCE= X-Google-Smtp-Source: AGHT+IF9E6JKQPi9tluJ6OUr25qldD3NRwdoH8mAO1y99S6f3XNZ1rtMYosl0B7oAQQXT+UROXeuYw== X-Received: by 2002:a5d:6da6:0:b0:38d:d166:d44 with SMTP id ffacd0b85a97d-3997959ce47mr437009f8f.23.1742408582915; Wed, 19 Mar 2025 11:23:02 -0700 (PDT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Peter Maydell , Juan Quintela , Ilya Leoshkevich , Thomas Huth , Akihiko Odaki , qemu-ppc@nongnu.org, David Gibson , qemu-s390x@nongnu.org, Wainer dos Santos Moschetta , Peter Xu , Markus Armbruster , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Daniel Henrique Barboza , David Hildenbrand , Yonggang Luo , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Richard Henderson , Beraldo Leal , qemu-arm@nongnu.org, Greg Kurz , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Nicholas Piggin , Paolo Bonzini , "Edgar E. Iglesias" Subject: [PATCH 07/10] target/ppc: convert gdbstub to new helper (!hacky) Date: Wed, 19 Mar 2025 18:22:52 +0000 Message-Id: <20250319182255.3096731-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250319182255.3096731-1-alex.bennee@linaro.org> References: <20250319182255.3096731-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1742408752337019000 By passing the explicit state of LE/BE via the memop we can avoid the messing about we do with ppc_maybe_bswap_register() at least for supplying register values to gdbstub. The fact we still need the helper for setting the values probably indicates we could do with a reverse helper, possibly to setting env vars directly? This is complicated by aliasing though. Signed-off-by: Alex Benn=C3=A9e --- target/ppc/gdbstub.c | 192 ++++++++++++++++++++++++------------------- 1 file changed, 108 insertions(+), 84 deletions(-) diff --git a/target/ppc/gdbstub.c b/target/ppc/gdbstub.c index c09e93abaf..663a97d986 100644 --- a/target/ppc/gdbstub.c +++ b/target/ppc/gdbstub.c @@ -20,7 +20,7 @@ #include "qemu/osdep.h" #include "cpu.h" #include "exec/gdbstub.h" -#include "gdbstub/helpers.h" +#include "gdbstub/registers.h" #include "internal.h" =20 static int ppc_gdb_register_len_apple(int n) @@ -74,12 +74,12 @@ static int ppc_gdb_register_len(int n) } =20 /* - * We need to present the registers to gdb in the "current" memory - * ordering. For user-only mode we get this for free; - * TARGET_BIG_ENDIAN is set to the proper ordering for the - * binary, and cannot be changed. For system mode, - * TARGET_BIG_ENDIAN is always set, and we must check the current - * mode of the chip to see if we're running in little-endian. + * We need to map the target endian registers from gdb in the + * "current" memory ordering. For user-only mode we get this for free; + * TARGET_BIG_ENDIAN is set to the proper ordering for the binary, and + * cannot be changed. For system mode, TARGET_BIG_ENDIAN is always + * set, and we must check the current mode of the chip to see if we're + * running in little-endian. */ static void ppc_maybe_bswap_register(CPUPPCState *env, uint8_t *mem_buf, i= nt len) { @@ -98,6 +98,38 @@ static void ppc_maybe_bswap_register(CPUPPCState *env, u= int8_t *mem_buf, int len #endif } =20 +/* + * We need to present the registers to gdb in the "current" memory + * ordering. For user-only mode this is hardwired by TARGET_BIG_ENDIAN + * and cannot be changed. For system mode we must check the current + * mode of the chip to see if we're running in little-endian. + */ +static MemOp ppc_gdb_memop(CPUPPCState *env, int len) +{ +#ifndef CONFIG_USER_ONLY + MemOp end =3D FIELD_EX64(env->msr, MSR, LE) ? MO_LE : MO_BE; +#else + #ifdef TARGET_BIG_ENDIAN + MemOp end =3D MO_BE; + #else + MemOp end =3D MO_LE; + #endif +#endif + + return size_memop(len) | end; +} + +/* + * Helpers copied from helpers.h just for loading target_ulong values + * from gdbstub's GByteArray + */ + +#if TARGET_LONG_BITS =3D=3D 64 +#define ldtul_p(addr) ldq_p(addr) +#else +#define ldtul_p(addr) ldl_p(addr) +#endif + /* * Old gdb always expects FP registers. Newer (xml-aware) gdb only * expects whatever the target description contains. Due to a @@ -109,51 +141,50 @@ static void ppc_maybe_bswap_register(CPUPPCState *env= , uint8_t *mem_buf, int len int ppc_cpu_gdb_read_register(CPUState *cs, GByteArray *buf, int n) { CPUPPCState *env =3D cpu_env(cs); - uint8_t *mem_buf; int r =3D ppc_gdb_register_len(n); + MemOp mo; =20 if (!r) { return r; } =20 + mo =3D ppc_gdb_memop(env, r); + if (n < 32) { /* gprs */ - gdb_get_regl(buf, env->gpr[n]); + return gdb_get_register_value(mo, buf, (uint8_t *) &env->gpr[n]); } else { switch (n) { case 64: - gdb_get_regl(buf, env->nip); - break; + return gdb_get_register_value(mo, buf, (uint8_t *) &env->nip); case 65: - gdb_get_regl(buf, env->msr); - break; + return gdb_get_register_value(mo, buf, (uint8_t *) &env->msr); case 66: { uint32_t cr =3D ppc_get_cr(env); - gdb_get_reg32(buf, cr); - break; + return gdb_get_register_value(ppc_gdb_memop(env, 4), buf, = (uint8_t *) &cr); } case 67: - gdb_get_regl(buf, env->lr); + return gdb_get_register_value(mo, buf, (uint8_t *) &env->lr); break; case 68: - gdb_get_regl(buf, env->ctr); + return gdb_get_register_value(mo, buf, (uint8_t *) &env->ctr); break; case 69: - gdb_get_reg32(buf, cpu_read_xer(env)); - break; + uint32_t val =3D cpu_read_xer(env); + return gdb_get_register_value(ppc_gdb_memop(env, 4), buf, (uin= t8_t *) &val); } } - mem_buf =3D buf->data + buf->len - r; - ppc_maybe_bswap_register(env, mem_buf, r); - return r; + + return 0; } =20 int ppc_cpu_gdb_read_register_apple(CPUState *cs, GByteArray *buf, int n) { CPUPPCState *env =3D cpu_env(cs); - uint8_t *mem_buf; int r =3D ppc_gdb_register_len_apple(n); + MemOp mo =3D ppc_gdb_memop(env, r); + int actual =3D 0; =20 if (!r) { return r; @@ -161,44 +192,48 @@ int ppc_cpu_gdb_read_register_apple(CPUState *cs, GBy= teArray *buf, int n) =20 if (n < 32) { /* gprs */ - gdb_get_reg64(buf, env->gpr[n]); + actual =3D gdb_get_register_value(mo, buf, (uint8_t *) &env->gpr[n= ]); } else if (n < 64) { /* fprs */ - gdb_get_reg64(buf, *cpu_fpr_ptr(env, n - 32)); + actual =3D gdb_get_register_value(mo, buf, (uint8_t *) cpu_fpr_ptr= (env, n - 32)); } else if (n < 96) { - /* Altivec */ - gdb_get_reg64(buf, n - 64); - gdb_get_reg64(buf, 0); + /* Altivec - where are they? ppc_vsr_t vsr[64]? */ + uint64_t empty =3D 0; + actual =3D gdb_get_register_value(mo, buf, (uint8_t *) &empty); + actual =3D gdb_get_register_value(mo, buf, (uint8_t *) &empty); } else { switch (n) { case 64 + 32: - gdb_get_reg64(buf, env->nip); + actual =3D gdb_get_register_value(mo, buf, (uint8_t *) &env->n= ip); break; case 65 + 32: - gdb_get_reg64(buf, env->msr); + actual =3D gdb_get_register_value(mo, buf, (uint8_t *) &env->m= sr); break; case 66 + 32: - { - uint32_t cr =3D ppc_get_cr(env); - gdb_get_reg32(buf, cr); - break; - } + { + uint32_t cr =3D ppc_get_cr(env); + actual =3D gdb_get_register_value(mo, buf, (uint8_t *) &cr); + break; + } case 67 + 32: - gdb_get_reg64(buf, env->lr); + actual =3D gdb_get_register_value(mo, buf, (uint8_t *) &env->l= r); break; case 68 + 32: - gdb_get_reg64(buf, env->ctr); + actual =3D gdb_get_register_value(mo, buf, (uint8_t *) &env->c= tr); break; case 69 + 32: - gdb_get_reg32(buf, cpu_read_xer(env)); + { + uint32_t xer =3D cpu_read_xer(env); + actual =3D gdb_get_register_value(mo, buf, (uint8_t *) &xer); break; + } case 70 + 32: - gdb_get_reg64(buf, env->fpscr); + actual =3D gdb_get_register_value(mo, buf, (uint8_t *) &env->f= pscr); break; } } - mem_buf =3D buf->data + buf->len - r; - ppc_maybe_bswap_register(env, mem_buf, r); + + g_assert(r =3D=3D actual); return r; } =20 @@ -210,6 +245,9 @@ int ppc_cpu_gdb_write_register(CPUState *cs, uint8_t *m= em_buf, int n) if (!r) { return r; } + + g_assert(r =3D=3D n); + =20 ppc_maybe_bswap_register(env, mem_buf, r); if (n < 32) { /* gprs */ @@ -367,18 +405,16 @@ static int gdb_get_spr_reg(CPUState *cs, GByteArray *= buf, int n) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); CPUPPCState *env =3D &cpu->env; + MemOp mo =3D ppc_gdb_memop(env, TARGET_LONG_SIZE); + target_ulong val; int reg; - int len; =20 reg =3D gdb_find_spr_idx(env, n); if (reg < 0) { return 0; } =20 - len =3D TARGET_LONG_SIZE; - /* Handle those SPRs that are not part of the env->spr[] array */ - target_ulong val; switch (reg) { #if defined(TARGET_PPC64) case SPR_CFAR: @@ -400,10 +436,7 @@ static int gdb_get_spr_reg(CPUState *cs, GByteArray *b= uf, int n) default: val =3D env->spr[reg]; } - gdb_get_regl(buf, val); - - ppc_maybe_bswap_register(env, gdb_get_reg_ptr(buf, len), len); - return len; + return gdb_get_register_value(mo, buf, (uint8_t *) &val); } =20 static int gdb_set_spr_reg(CPUState *cs, uint8_t *mem_buf, int n) @@ -441,18 +474,14 @@ static int gdb_get_float_reg(CPUState *cs, GByteArray= *buf, int n) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); CPUPPCState *env =3D &cpu->env; - uint8_t *mem_buf; + MemOp mo; if (n < 32) { - gdb_get_reg64(buf, *cpu_fpr_ptr(env, n)); - mem_buf =3D gdb_get_reg_ptr(buf, 8); - ppc_maybe_bswap_register(env, mem_buf, 8); - return 8; + mo =3D ppc_gdb_memop(env, 8); + return gdb_get_register_value(mo, buf, (uint8_t *)cpu_fpr_ptr(env,= n)); } if (n =3D=3D 32) { - gdb_get_reg32(buf, env->fpscr); - mem_buf =3D gdb_get_reg_ptr(buf, 4); - ppc_maybe_bswap_register(env, mem_buf, 4); - return 4; + mo =3D ppc_gdb_memop(env, 4); + return gdb_get_register_value(mo, buf, (uint8_t *) &env->fpscr); } return 0; } @@ -479,26 +508,21 @@ static int gdb_get_avr_reg(CPUState *cs, GByteArray *= buf, int n) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); CPUPPCState *env =3D &cpu->env; - uint8_t *mem_buf; + MemOp mo; =20 if (n < 32) { ppc_avr_t *avr =3D cpu_avr_ptr(env, n); - gdb_get_reg128(buf, avr->VsrD(0), avr->VsrD(1)); - mem_buf =3D gdb_get_reg_ptr(buf, 16); - ppc_maybe_bswap_register(env, mem_buf, 16); - return 16; + mo =3D ppc_gdb_memop(env, 16); + return gdb_get_register_value(mo, buf, (uint8_t *) avr); } if (n =3D=3D 32) { - gdb_get_reg32(buf, ppc_get_vscr(env)); - mem_buf =3D gdb_get_reg_ptr(buf, 4); - ppc_maybe_bswap_register(env, mem_buf, 4); - return 4; + uint32_t vscr =3D ppc_get_vscr(env); + mo =3D ppc_gdb_memop(env, 4); + return gdb_get_register_value(mo, buf, (uint8_t *) &vscr); } if (n =3D=3D 33) { - gdb_get_reg32(buf, (uint32_t)env->spr[SPR_VRSAVE]); - mem_buf =3D gdb_get_reg_ptr(buf, 4); - ppc_maybe_bswap_register(env, mem_buf, 4); - return 4; + mo =3D ppc_gdb_memop(env, 4); + return gdb_get_register_value(mo, buf, (uint8_t *) &env->spr[SPR_V= RSAVE]); } return 0; } @@ -532,25 +556,25 @@ static int gdb_get_spe_reg(CPUState *cs, GByteArray *= buf, int n) { PowerPCCPU *cpu =3D POWERPC_CPU(cs); CPUPPCState *env =3D &cpu->env; + MemOp mo; =20 if (n < 32) { #if defined(TARGET_PPC64) - gdb_get_reg32(buf, env->gpr[n] >> 32); - ppc_maybe_bswap_register(env, gdb_get_reg_ptr(buf, 4), 4); + uint32_t low =3D env->gpr[n] >> 32; + mo =3D ppc_gdb_memop(env, 4); + return gdb_get_register_value(mo, buf, (uint8_t *) &low); #else - gdb_get_reg32(buf, env->gprh[n]); + mo =3D ppc_gdb_memop(env, 4); + return gdb_get_register_value(mo, buf, (uint8_t *) &env->gprh[n]); #endif - return 4; } if (n =3D=3D 32) { - gdb_get_reg64(buf, env->spe_acc); - ppc_maybe_bswap_register(env, gdb_get_reg_ptr(buf, 8), 8); - return 8; + mo =3D ppc_gdb_memop(env, 8); + return gdb_get_register_value(mo, buf, (uint8_t *) &env->spe_acc); } if (n =3D=3D 33) { - gdb_get_reg32(buf, env->spe_fscr); - ppc_maybe_bswap_register(env, gdb_get_reg_ptr(buf, 4), 4); - return 4; + mo =3D ppc_gdb_memop(env, 4); + return gdb_get_register_value(mo, buf, (uint8_t *) &env->spe_fscr); } return 0; } @@ -593,9 +617,9 @@ static int gdb_get_vsx_reg(CPUState *cs, GByteArray *bu= f, int n) CPUPPCState *env =3D &cpu->env; =20 if (n < 32) { - gdb_get_reg64(buf, *cpu_vsrl_ptr(env, n)); - ppc_maybe_bswap_register(env, gdb_get_reg_ptr(buf, 8), 8); - return 8; + return gdb_get_register_value(ppc_gdb_memop(env, 8), + buf, + (uint8_t *)cpu_vsrl_ptr(env, n)); } return 0; } --=20 2.39.5