From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1585) id E1C4F3834E6C; Wed, 1 Jun 2022 10:24:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E1C4F3834E6C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Luis Machado To: gdb-cvs@sourceware.org Subject: [binutils-gdb] [arm] d0..d15 are 64-bit each, not 32-bit X-Act-Checkin: binutils-gdb X-Git-Author: Yvan Roux X-Git-Refname: refs/heads/master X-Git-Oldrev: 1d2eeb660f0885807320792ee18c033b34522225 X-Git-Newrev: 39fc7ff66b30f1581d4a1a97e6857b6bfcccf860 Message-Id: <20220601102458.E1C4F3834E6C@sourceware.org> Date: Wed, 1 Jun 2022 10:24:58 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 01 Jun 2022 10:24:59 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D39fc7ff66b30= f1581d4a1a97e6857b6bfcccf860 commit 39fc7ff66b30f1581d4a1a97e6857b6bfcccf860 Author: Yvan Roux Date: Wed Jun 1 11:08:00 2022 +0000 [arm] d0..d15 are 64-bit each, not 32-bit =20 When unwinding the stack, the floating point registers d0 to d15 need to be handled as double words, not words. =20 Only the first 8 registers have been confirmed fixed with this patch on a STM32F407-DISC0 board, but the upper 8 registers on Cortex-M33 should be handled in the same way. =20 The test consisted of running a program compiled with float-abi=3Dhard. In the main function, a function taking a double as an argument was called. After the function call, a hardware timer was used to trigger an interrupt. =20 In the debug session, a breakpoint was set in the function called from main to verify the content of the registers using "info float" and another breakpoint in the interrupt handler was used to check the same registers using "info float" on frame 2 (the frame just before the dummy frame created for the signal handler in gdb). =20 Signed-off-by: Torbj=C3=B6rn SVENSSON Signed-off-by: Yvan Roux Diff: --- gdb/arm-tdep.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c index 5ea66898747..d35c49bc1ea 100644 --- a/gdb/arm-tdep.c +++ b/gdb/arm-tdep.c @@ -3464,10 +3464,10 @@ arm_m_exception_cache (struct frame_info *this_fram= e) =20 /* Extended stack frame type used. */ fpu_regs_stack_offset =3D unwound_sp + sp_r0_offset + 0x20; - for (i =3D 0; i < 16; i++) + for (i =3D 0; i < 8; i++) { cache->saved_regs[ARM_D0_REGNUM + i].set_addr (fpu_regs_stack_offset); - fpu_regs_stack_offset +=3D 4; + fpu_regs_stack_offset +=3D 8; } cache->saved_regs[ARM_FPSCR_REGNUM].set_addr (unwound_sp + sp_r0_off= set + 0x60); fpu_regs_stack_offset +=3D 4; @@ -3476,10 +3476,10 @@ arm_m_exception_cache (struct frame_info *this_fram= e) { /* Handle floating-point callee saved registers. */ fpu_regs_stack_offset =3D 0x90; - for (i =3D 16; i < 32; i++) + for (i =3D 8; i < 16; i++) { cache->saved_regs[ARM_D0_REGNUM + i].set_addr (fpu_regs_stack_offse= t); - fpu_regs_stack_offset +=3D 4; + fpu_regs_stack_offset +=3D 8; } =20 arm_cache_set_active_sp_value (cache, tdep, unwound_sp + sp_r0_offset += 0xD0);