Commit Graph

7 Commits

Author SHA1 Message Date
zhuyanlin
df6985e2bf jlink-nuttx: update regs as nuttx regs save path change
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-04-05 13:33:00 +02:00
Xiang Xiao
3259b7d700 tools/jlink: Change the type of pid from uint16_t to uint32_t
follow up the bellow chnage:
commit 0f2f48f8ba
Author: Xiang Xiao <xiaoxiang@xiaomi.com>
Date:   Sun Mar 20 18:12:26 2022 +0800

    sys/type.h: Change pid_t from int16_t to int

    to fix the following warning:
    include/unistd.h:302:9: error: incompatible redeclaration of library function 'vfork' [-Werror,-Wincompatible-library-redeclaration]
    pid_t   vfork(void);
            ^
    include/unistd.h:302:9: note: 'vfork' is a builtin with type 'int (void)'

    and change 32768 to INT_MAX to match the type change

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2022-03-23 11:00:49 +02:00
Michael Jung
fd8b087012 Fix JLinkGDBServer crash attaching to target
If attaching to a target that is already running JLinkGDBServer calls
RTOS_GetNumThreads() without a prior call to RTOS_UpdateThreads().  So
do this within RTOS_GetNumThreads() if g_plugin_priv.ntcb has not yet
been initialized.

Note: If after attaching the debugger to the target, the target is
resumed and then stopped again, the RTOS_UpdateThreads is actually
called.  Thus, we are not running on stale thread data in this case.

I also changed PLUGIN_VER to API_VER and its value to 101, as
RTOS_GetVersion() does not query the version of the plugin, but the API
version implemented by the plugin, which in our case is 1.1.

Signed-off-by: Michael Jung <mijung@gmx.net>
2022-02-15 23:05:15 +08:00
Michael Jung
0a37744826 Fix jlink-nuttx build with GCC 10.2
The packed-attribute on the tcb_info_s type was misplaced, which caused
incompatible memory layout between host and target.  According to
current GCC documentation:

> You may specify type attributes in an enum, struct or union type
> declaration or definition by placing them immediately after the struct,
> union or enum keyword.  You can also place them just past the closing
> curly brace of the definition, but this is less preferred because
> logically the type should be fully defined at the closing brace.

I also added jlink-nuttx.so to the .gitignore list and updated nxstyle
to ignore the camel case function names required by JLinkGDBServer.

Signed-off-by: Michael Jung <mijung@gmx.net>
2022-02-15 13:48:52 +01:00
zhuyanlin
6578461cc8 tcbinfo: add packet align to struct tcbinfo
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-01-27 17:36:27 +08:00
zhuyanlin
8f1c6ee7bc tools/jlink-nuttx: update tcbinfo follow nuttx arch tcbinfo_s
Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2022-01-27 17:36:27 +08:00
zhuyanlin
407bc04934 tools: add gdbplugin for JLinkGDBServer nuttx thread aware
Use `JLinkGDBServer -rtos libnuttxplugin` to add this plugin.
Then in gdb can use command:
  - `info threads` to show all threads infos
  - `thread (id) ` to switch thread.
  - `bt` to show thread backtrace.

Signed-off-by: zhuyanlin <zhuyanlin1@xiaomi.com>
2021-11-10 14:31:10 -03:00