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 2021/11/23 03:58:17 UTC

[incubator-nuttx] branch master updated (e5cf5fa -> 33044cd)

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git.


    from e5cf5fa  libc/psignal: Output the message to STDERR_FILENO instead STDOUT_FILENO
     new 6268fbd  tools/gdbinit: add sim:x86-m32 support
     new 33044cd  tools/gdbinit: fix symbol mismatch if BOARD_LATE_INITIALIZE disable

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tools/nuttx-gdbinit | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

[incubator-nuttx] 02/02: tools/gdbinit: fix symbol mismatch if BOARD_LATE_INITIALIZE disable

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 33044cdd10708af974aa82f55b0dca69b10b59ba
Author: chao.an <an...@xiaomi.com>
AuthorDate: Mon Nov 8 20:43:54 2021 +0800

    tools/gdbinit: fix symbol mismatch if BOARD_LATE_INITIALIZE disable
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 tools/nuttx-gdbinit | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/nuttx-gdbinit b/tools/nuttx-gdbinit
index 742b6c3..583ed94 100644
--- a/tools/nuttx-gdbinit
+++ b/tools/nuttx-gdbinit
@@ -46,11 +46,11 @@ define _examine_arch
   gdb.execute("set $_target_arch = \"i386:x86-64\"")
 
   # NOTE: we assume that sim has sim_bringup function
-  python if (type(gdb.lookup_global_symbol("sim_bringup")) is gdb.Symbol \
+  python if (type(gdb.lookup_static_symbol("sim_start")) is gdb.Symbol \
              and _target_arch.name() == 'i386') : \
   gdb.execute("set $_target_arch=\"sim:x86\"")
 
-  python if (type(gdb.lookup_global_symbol("sim_bringup")) is gdb.Symbol \
+  python if (type(gdb.lookup_static_symbol("sim_start")) is gdb.Symbol \
              and _target_arch.name() == 'i386:x86-64') : \
   gdb.execute("set $_target_arch=\"sim:x86-64\"")
 end

[incubator-nuttx] 01/02: tools/gdbinit: add sim:x86-m32 support

Posted by xi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 6268fbd208d6e67ff2f06f83f3579f9e8dc9c469
Author: chao.an <an...@xiaomi.com>
AuthorDate: Fri Nov 5 23:56:06 2021 +0800

    tools/gdbinit: add sim:x86-m32 support
    
    Signed-off-by: chao.an <an...@xiaomi.com>
---
 tools/nuttx-gdbinit | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/tools/nuttx-gdbinit b/tools/nuttx-gdbinit
index 89bb04e..742b6c3 100644
--- a/tools/nuttx-gdbinit
+++ b/tools/nuttx-gdbinit
@@ -46,7 +46,12 @@ define _examine_arch
   gdb.execute("set $_target_arch = \"i386:x86-64\"")
 
   # NOTE: we assume that sim has sim_bringup function
-  python if (type(gdb.lookup_global_symbol("sim_bringup")) is gdb.Symbol) : \
+  python if (type(gdb.lookup_global_symbol("sim_bringup")) is gdb.Symbol \
+             and _target_arch.name() == 'i386') : \
+  gdb.execute("set $_target_arch=\"sim:x86\"")
+
+  python if (type(gdb.lookup_global_symbol("sim_bringup")) is gdb.Symbol \
+             and _target_arch.name() == 'i386:x86-64') : \
   gdb.execute("set $_target_arch=\"sim:x86-64\"")
 end
 
@@ -133,6 +138,9 @@ define _save_tcb
   if ($_streq($_target_arch, "sim:x86-64") == 1)
     _save_tcb_simx86-64 $tcb
   end
+  if ($_streq($_target_arch, "sim:x86") == 1)
+    _save_tcb_simx86 $tcb
+  end
 end
 
 define _save_current_tcb
@@ -177,6 +185,9 @@ define _switch_tcb
   if ($_streq($_target_arch, "sim:x86-64") == 1)
     _switch_tcb_simx86-64 $tcb
   end
+  if ($_streq($_target_arch, "sim:x86") == 1)
+    _switch_tcb_simx86 $tcb
+  end
 
   # update _current_tcb
   set $_current_tcb = $tcb
@@ -381,6 +392,29 @@ define _switch_tcb_simx86-64
   set $rip = $tcb.xcp.regs[7]
 end
 
+# see nuttx/arch/sim/src/sim/up_internal.h
+define _save_tcb_simx86
+  set $tcb = (struct tcb_s *)$arg0
+  set $tcb.xcp.regs[0] = $ebx
+  set $tcb.xcp.regs[1] = $esi
+  set $tcb.xcp.regs[2] = $edi
+  set $tcb.xcp.regs[3] = $ebp
+  set $tcb.xcp.regs[4] = $sp
+  set $tcb.xcp.regs[5] = $pc
+
+  set $_pc_reg_idx = 5
+end
+
+define _switch_tcb_simx86
+  set $tcb = (struct tcb_s *)$arg0
+  set $ebx = $tcb.xcp.regs[0]
+  set $esi = $tcb.xcp.regs[1]
+  set $edi = $tcb.xcp.regs[2]
+  set $ebp = $tcb.xcp.regs[3]
+  set $sp  = $tcb.xcp.regs[4]
+  set $pc  = $tcb.xcp.regs[5]
+end
+
 define nxthread
   _examine_target
   _save_current_tcb