-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debug: add tools for task aware debug #4810
Conversation
When enable DEBUG_TCBINFO config, a global struct will provide, then debuggers can aware nuttx task infomation. Signed-off-by: zhuyanlin <[email protected]>
Add tcbinfo in procfs system. Signed-off-by: zhuyanlin <[email protected]>
Please ignore the "Mixed case" checkpatch error. As there are SEGGER JLINK plugin API defination. |
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 <[email protected]>
This is not building for me. After enabling
I think that |
@fjpanag you need add arm_tcbinfo.c to your SoC Make.defs. |
@xiaoxiang781216 What do you mean I am trying this on an ARM Cortex M3, and I am using the NuttX Shouldn't this file be included in the build just like the rest of the |
I just freshly cloned nuttx and apps. I tried:
and the build succeeds. I then enabled I guess this does not have to do with my configuration. |
arm_tcbinfo.c is a new addition, so you need add it to this file: |
@xiaoxiang781216 sorry for the late reply. I added Furthermore, I tried building the JLink lib, but it also fails:
|
could be.
What's result if you add -fPIC?
Which OS do you compile? @zhuyanlinzyl could you take a look? |
It builds successfully, I have yet to test it though...
Fedora 34 with GCC:
|
Well, in fact I just tried it. It crashes with a SEGFAULT:
|
Summary
Patch 1: add tcb strcut for task-aware debug information
Patch 2: add tcbinfo struct in procfs
Patch 3: add plugin in JLinkGDBServer for nuttx thread aware
Impact
No. Enhance nuttx debug feature.
Testing
When nuttx config with
CONFIG_DEBUG_TCBINFO
.We can debug nuttx with nuttx thread aware.
1 show nuttx threads
2 change nuttx thread
3 show task backtrace