TotalCross / TotalCross/totalcross
Debug support with TotalCross
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 227
- Forks
- 42
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 11
Description
Is your feature request related to a problem? Please describe.
Nowadays being able to debug a live application is a crucial part of the development process. This feature request describes a possible solution.
Describe the solution you'd like
The JDWP protocol should be followed. The debugger should be able to connect to the TC application and perform the usual debug commands.
Describe alternatives you've considered
There is a similar solution in another project, debugging RoboVM applications. It would be nice is to extract only the debugging solution and embed it into TotalCross.
This solution is a client-server solution. A Java application would become a virtual "debuggee", where the actual debugger will connect to it and it will support the full JDWP protocol. This Java application works like a proxy which will forward calls to the actual running application through a new, much simpler protocol. Then the actual application will be connected to the virtual debuggee, through this private protocol, which will then execute the appropriate debugging commands.
The benefits of this approach is that the protocol needed to be implemented on the actual runtime application is much simple and consistent, than the JDWP protocol, as well as easier to port.
Devices
All TC supported devices.
Additional context
Here is a possible checklist of the steps required:
- Extract Java debugee code from RoboVM and make it self-compilable
- Locate and extract RoboVM-related C++ VM files which implement the private protocol
- Transfer the RVM C++ files into TC and make it compile
- Transfer files and embed them using the TC schematics
- Fix includes
- Fix data structures
- Fix method calls
- Inject protocol server into TC lifecycle
- Start a TC application with the protocol enabled and try to connect
- Implement TC-related commands:
- Read/write from/to memory basic structs and bits
- Allocate/free memory blocks (i.e. String or other objects)
- Create new String/array/instance
- Suspend/resume/step thread
- Invoke threads
- Inform back to the virtual debuggee information like
- Attached threads
- Started threads
- Detached threads
- Suspended threads
- Resumed threads
- Stepped threads
- Breakpoints
- Loaded classes
- Exceptions
- Use a real debugger to test all of the above
- Documentation on how to use this feature
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the extracted RoboVM Java debuggee and transferred RoboVM C++ VM files first. Use the checklist as the scope: inject the protocol server into the TotalCross lifecycle, implement the listed commands, connect a real debugger, and document usage across supported devices.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, java
- Domain
- devtools, embedded-iot
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 15/100