You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/11/23 03:23:53 UTC
[incubator-nuttx] branch releases/10.0 updated: tools: Fix
nuttx-gdbinit for armv7-m with FPU
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch releases/10.0
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/releases/10.0 by this push:
new 2f7092b tools: Fix nuttx-gdbinit for armv7-m with FPU
2f7092b is described below
commit 2f7092b50e2aa89e397e5f938460adca3fe47470
Author: Masayuki Ishikawa <ma...@gmail.com>
AuthorDate: Mon Nov 23 08:31:35 2020 +0900
tools: Fix nuttx-gdbinit for armv7-m with FPU
Summary:
- Brennan reported the script does not work with nucleo-h743zi:otg_fs_host
- Actually, the config uses FPU but the script did not detect it
- The script assumed that the nuttx contains fpuconfig symbol
- However, this assumption was incorrect
- This commit fixes this issue by detecting FPU with tcb->xcp.regs
Impact:
- Cortex-M targets
Testing:
- Tested with lm3s6965-ek:discover (Cortex-M3)
- Tested with spresense:wifi_smp (Cortex-M4F)
- Tested with sim:smp (x86_64)
Signed-off-by: Masayuki Ishikawa <Ma...@jp.sony.com>
---
tools/nuttx-gdbinit | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/tools/nuttx-gdbinit b/tools/nuttx-gdbinit
index 2266bf4..89c95bf 100644
--- a/tools/nuttx-gdbinit
+++ b/tools/nuttx-gdbinit
@@ -48,9 +48,15 @@ define _examine_target
if ($_target_examined == 0x0)
_examine_arch
- python gdb.execute("set $_target_has_fpu = 0")
- python if (type(gdb.lookup_global_symbol("fpuconfig")) is gdb.Symbol) : \
- gdb.execute("set $_target_has_fpu = 1")
+ set $_tcb0 = g_pidhash[0].tcb
+ set $_xcp_nregs = sizeof($_tcb0->xcp.regs) / sizeof($_tcb0->xcp.regs[0])
+ set $_target_has_fpu = 0
+
+ if ($_streq($_target_arch, "armv7e-m") == 1)
+ if ($_xcp_nregs != 19)
+ set $_target_has_fpu = 1
+ end
+ end
python gdb.execute("set $_target_has_smp = 0")
python if (type(gdb.lookup_global_symbol("g_assignedtasks")) is gdb.Symbol) : \