Fix debugging in VSCode before kernel is started
Address the “Known problems in JlinkGDBServer” section of the README. Reporting 0 active threads confuses GDB and it does not call RTOS_GetThreadId, instead assuming the current thread has an ID of 0xDEAD. Report a minimum of one active thread and use 0xDEAD as a placeholder thread ID if a real thread cannot be found.
Signed-off-by: Josh DeWitt josh.dewitt@garmin.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
Zephyr RTOS plugin for JlinkGDBserver
This plugins provides information of Zephyr RTOS threads for any GDB aware UI that uses Jlink’s GDBServer.
The work is developed on top of Seggers Jlink GDB Server SDK.
License
The following files are directly coming from Segger SDK:
JLINKARM_Const.hRTOSPlugin.hTYPES.hSee file License.txt for Segger SDK license.
All other plugin files are licensed under Apache-2.0.
Building
I have replaced the original Makefile based build rules with just a simple CMake file.
To build the plugin on Linux & macOS:
To build the plugin on Linux 32-bit, on 64-bit host (ensure multilib is installed):
To build it on Windows, you will need Visual Studio 16 (2019):
Or you could skip the last command and load the
.slnwith Visual Studio and rebuild everything.Usage
First, the application must build with
That is mandatory to make requires symbols visible in final elf file.
To see the Threads, you need to pass the plugin for JLinkGDBServer as a parameter
Using with west
If you start your debug session with Zephyr’s west tool, you may add the plugin path to the command line:
By default, the plugin is installed in GDBServer directory under JLink’s libraries. If the command above does not work, or you are using a plugin build from these sources, you need to use absolute path, shell characters like
~might not work.Note that because of of west python scrip wraps around the command, you need to escape the
\character on Windows.Using with Cortex-Debug plugin for VSCode
You can use the plugin with Cortex-Debug by defining following
launch.jsonUsing with macOS
On macOS,
JLinkGDBServeris built with library validation options that require built plugins to becodesigned with the same Team ID as the executable. By default this means that you cannot run plugins that you build yourself. This can however be worked around by manually removing the signatures onJLinkGDBServer(After creating a backup of the original file).This will most likely break the usage of other plugins until the backup is restored.
Known problems
main()before stopping at all.