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/nuttx.git

commit fa8aff6d9b85c621f9642bf0648c0add8bf2916d
Author: Gao Jiawei <[email protected]>
AuthorDate: Thu Aug 22 09:55:27 2024 +0800

    regression: use stack TLS region to retrieve task argument vector
    
    ta_argv is removed, we use pointer to the TLS instead
    
    Signed-off-by: Gao Jiawei <[email protected]>
---
 tools/gdb/thread.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/tools/gdb/thread.py b/tools/gdb/thread.py
index 8ab88210df..a1e90cdea9 100644
--- a/tools/gdb/thread.py
+++ b/tools/gdb/thread.py
@@ -448,11 +448,18 @@ class Ps(gdb.Command):
             ptcb = cast2ptr(tcb, "struct pthread_tcb_s")
             arg = ptcb["arg"]
             cmd = " ".join((name, hex(entry), hex(arg)))
+        elif tcb["pid"] < get_macro("CONFIG_SMP_NCPUS"):
+            # This must be the Idle Tasks, hence we just get its name
+            cmd = name
         else:
-            argv = tcb["group"]["tg_info"]["ta_argv"] + 1
-
+            # For tasks other than pthreads, hence need to get its command line
+            # arguments from
+            argv = (
+                tcb["stack_alloc_ptr"]
+                + cast2ptr(tcb["stack_alloc_ptr"], "struct 
tls_info_s")["tl_size"]
+            )
             args = []
-            parg = argv
+            parg = argv.cast(gdb.lookup_type("char").pointer().pointer()) + 1
             while parg.dereference():
                 args.append(parg.dereference().string())
                 parg += 1

Reply via email to