Debugging RT threads with GDB on ARM/PowerPC
Hello,
I understood that GDB can be used to debug Xenomai real-time applications but it seems not to work with my application on PowerPC or ARM. The applications looses determinism quickly, mainly because RT threads switch to secondary mode somehow. Have I missed something? Are there any known issues with GDB on ARM or PowerPC?
Wolfgang.
Quoted 8 lines · Wolfgang Grandegger
Hello,
I understood that GDB can be used to debug Xenomai real-time applications but it seems not to work with my application on PowerPC or ARM. The applications looses determinism quickly, mainly because RT threads switch to secondary mode somehow. Have I missed something? Are there any known issues with GDB on ARM or PowerPC?
Using GDB means that you lose determinism, by essence. Debugging time can't be for free anyway. Additionally, GDB is based on ptrace(), ptrace() makes heavy use of Linux signals to control the debuggee, so as a matter of fact, the application under debug has to switch to secondary mode each time GDB takes control over it, which means, most of the time as soon as you are actually debugging it. The same goes for breakpointing, since this triggers faults, hence needs a switch to Linux mode as well, because ptrace() would not be happy to process the breakpoint in the middle of a primary context.
This is not a ppc or arm issue. This is common to all archs.
Quoted 7 lines
Wolfgang.
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help
Signature · 1 line
Philippe.
Quoted 19 lines · Philippe Gerum
Quoted 8 lines · Wolfgang Grandegger
Hello,
I understood that GDB can be used to debug Xenomai real-time applications but it seems not to work with my application on PowerPC or ARM. The applications looses determinism quickly, mainly because RT threads switch to secondary mode somehow. Have I missed something? Are there any known issues with GDB on ARM or PowerPC?
Using GDB means that you lose determinism, by essence. Debugging time can't be for free anyway. Additionally, GDB is based on
ptrace(),ptrace()makes heavy use of Linux signals to control the debuggee, so as a matter of fact, the application under debug has to switch to secondary mode each time GDB takes control over it, which means, most of the time as soon as you are actually debugging it. The same goes for breakpointing, since this triggers faults, hence needs a switch to Linux mode as well, becauseptrace()would not be happy to process the breakpoint in the middle of a primary context.
Quoted 1 line
This is not a ppc or arm issue. This is common to all archs.
OK, that's what I suspected. After the first GDB intervention, real-time is lost. Thanks for clarification.
Wolfgang.