tools/nxgdb: Add gdb and statenames for TSTATE_WAIT_EVENT

This patch add new taskstate entry in tools/pynuttx/nxgdb/thread.py
   and in sched_get_stateinfo.c/g_statenames for the new added task
   state: TSTATE_WAIT_EVENT

   test log is:
     nsh> ps
       PID  PPID GROUP PRI POLICY   TYPE    NPX STATE    EVENT     SIGMASK            STACK    USED FILLED COMMAND
         0     0     0   0 FIFO     Kthread   - Ready              0000000000000000 0001008 0000196  19.4%  Idle_Task
         1     0     0 192 FIFO     Kthread   - Waiting  Semaphore 0000000000000000 0001984 0000016   0.8%  hpwork 0x70000100 0x7000014c
         2     0     2 100 FIFO     Task      - Running            0000000000000000 0002008 0000740  36.8%  nsh_main
         4     0     0 100 FIFO     Kthread   - Waiting  Event     0000000000000000 0000984 0000012   1.2%  event_wait_task

Signed-off-by: Chengdong Wang wangchengdong@lixiang.com
This commit is contained in:
wangchengdong
2025-10-30 09:11:13 +08:00
committed by Alan C. Assis
parent de5973268b
commit d8304979b4
2 changed files with 5 additions and 0 deletions

View File

@@ -51,6 +51,9 @@ static FAR const char * const g_statenames[] =
"Inactive",
"Waiting,Semaphore",
"Waiting,Signal"
#ifdef CONFIG_SCHED_EVENTS
, "Waiting,Event"
#endif
#if !defined(CONFIG_DISABLE_MQUEUE) || !defined(CONFIG_DISABLE_MQUEUE_SYSV)
, "Waiting,MQ empty"
, "Waiting,MQ full"

View File

@@ -435,6 +435,8 @@ class TaskState(Enum):
Inactive = auto()
Waiting_Semaphore = auto()
Waiting_Signal = auto()
if utils.get_symbol_value("CONFIG_SCHED_EVENTS"):
Waiting_Event = auto()
if not utils.get_symbol_value(
"CONFIG_DISABLE_MQUEUE"
) or not utils.get_symbol_value("CONFIG_DISABLE_MQUEUE_SYSV"):