Comments (4)
You may be mistaken. Neither rtos-view nor cortex-debug uses the JLink plugin and not sure if there is such a thing. I wrote both. They complement each other rather than overlap.
You should read the architecture of our debugger (applies to most gdb based debuggers)
https://github.com/Marus/cortex-debug/wiki/Cortex-Debug-Under-the-hood
You may be confusing a gdb-server with a plugin. Bottom line is
- cortex-debug works with many gdb-servers, JLink included. But it doesn't really talk to any gdb-server for debugging. Instead, it talks to gdb.
- rtos-view doesn't even talk to gdb. It instead uses the debugger protocol. Both cortex-debug and rtos-views use this protocol. cortex-debug is more of a provider and rtos-view (and memory/peripheral views) is a consumer. This way, rtos-view can be debugger-independent and it does work with many debuggers.
You are also confusing the task view from VSCode (data provided by cortex-debug) with what this extension does. Again the protocol I mentioned is used and VSCode is the consumer. This extension shows you what task view does not show and cannot show. rtos-view can show task info even when the gdb-server is running in bare metal mode (ie, with no task/rtos support). We also don't want to duplicate what VSCode already does.
All the source code is public (there is not much) and you should study it. Also read the documents, specifications, open/closed issues.
Furthermore rtos-view plugin does its job better since it asks GDB client which have full knowledge how task control block structure looks like and user dont need to operate on raw memory offsets
Ummmm. No. GDB does not know anything about any RTOS or what a TCB is. gdb-servers and rtos-view do know about TCBs. GDB simply provides a service that can help with converting a symbol name to an address or value just like for any other C/C++/Rust/etc. language. GDB has an abstract construct for threads and gdb-servers use that concept to present/convert/emulate RTOS Tasks into gdb's idea of a thread. Some might argue RTOS tasks are similar to OS processes but I disagree. Very large topic.
Instead of looking at this specifically about your RTOS and your toolchain, you should try to research first the general concepts.
from cortex-debug.
In order to use JLink probes and see custom RTOS tasks in call stack view (screenshot below) there is a need to develop a JLink GDB server plugin [3], there is no need to develop this custom RTOS support in cortex-debug and rtos-view plugins.
Each RTOS in JLink requires a couple of hundred lines of C code to create support for it. They provide a free SDK upon request. You probably never asked them. As you saw, this is the most important document
https://www.segger.com/products/debug-probes/j-link/tools/j-link-gdb-server/thread-aware-debugging/
I think the SDK provides examples.
You will not worry about how gdb and JLink communicate or with gdb thread MI commands. GDB and JLInk use another protocol (serial protocol) to talk to each other and it looks nothing like MI. Also, gdb will never interact with your JLink RTOS plugin.
Btw, the same is true with any gdb-server (openocd, etc.) but the exact mechanism and language used may be different.
Thank you for this short introduction, sorry I too often skip research before creating code
That makes you dangerous 😄
Hope you now understand why rtos-view
does not duplicate work done by all the other tools. It helps debug/monitor the kernel data structures, task states, stack usage, and may even display tasks not shown by gdb-servers.
from cortex-debug.
Thank you for this short introduction, sorry I too often skip research before creating code
I will try to answer my original questions, please review my answer if I am correct.
I was wrong to think that the cortex-debug plugin is responsible for thread aware debugging, whereas the core responsibility in understanding RTOS data structures lies within the GDB client and server. GDB support many thread related facilities [1], I can see how it works by watching the GDB/MI communication log, there is a bunch of GDB/MI commands to gather threads info [2]
In order to use JLink probes and see custom RTOS tasks in call stack view (screenshot below) there is a need to develop a JLink GDB server plugin [3], there is no need to develop this custom RTOS support in cortex-debug
and rtos-view
plugins.
The feature that interests me the most: tasks in call stack view
[1] https://ftp.gnu.org/old-gnu/Manuals/gdb/html_node/gdb_24.html
[2] https://sourceware.org/gdb/current/onlinedocs/gdb.html/GDB_002fMI-Thread-Commands.html
[3] https://www.segger.com/products/debug-probes/j-link/tools/j-link-gdb-server/thread-aware-debugging/
from cortex-debug.
Plugin SDK is now free to download, you just need to register on JLink website. Running new plugin is pretty easy, there is a support for printing debug info in JLink GDB Server logs, so its easy to start working.
from cortex-debug.
Related Issues (20)
- gdb and non-ASCII symbols in filenames problems (again) HOT 2
- Feature request: focus on gdb terminal output while programming and on debug console when finished HOT 7
- TI ARM CLANG support
- RTT support for Black Magic Probe
- SEGGER rtt connection ended immediately after lunch the cortex-debug
- Take ipAddress from environment variable HOT 1
- gdbsever debugging is suddenly unavailable, everything was fine before
- loadFiles not working as expected with PE Micro servertype HOT 3
- Default value of "Live Watch Refresh Rate" should be a number HOT 1
- Installed extension failure
- Peripherals, registers, memory and disassemble all read "There is no data provider registered that can provide view data." when using the attached SVD file. HOT 6
- Missing variables in the Variables View HOT 1
- Live watch not updating value on esp32s3 with esp-prog; "Warn : [esp32s3.cpu0] target not halted" HOT 2
- Windows/WSL, debugger attempts to open unix-style file HOT 2
- Project status, is it still actively developed/maintained? HOT 2
- Status of this extension HOT 3
- GDB session ended. but the debug toolbar won't close. HOT 12
- OpenOCD stdout not showing up in the DEBUG CONSOLE HOT 9
- Peripheral Register/SVD Error HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cortex-debug.