-
Notifications
You must be signed in to change notification settings - Fork 25
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
Feature request: external debugger support #126
Comments
I think it's not as simple as it sounds. You can't use GDB because GDB knows nothing about the 6502 CPU. You can use it with FS-UAE/Win-UAE because the 68K is known by GDB. It's not because you use the GDB protocol that the external debugger magically knows the 6502 CPU. I think there are 2 different things
So, if you want use GDB as the debugger, you need to patch GDB in order to support the 6502. Same for Visual Studio. Maybe we can see how to add the GDB protocol to Oricutron. |
Oh, it is not simple, I only said "relatively easily", everything is in the "relatively". ;)
You are absolutely right.
I agree with your analysis and think going for a GDB based approach has very useful advantages:
Yup, absolutely.
I am not too sure since I have not read the docs but VS seems to use a dedicated version of GDB, so one probably only needs to port the 6502 support to that version so the effort could be very small (this needs to be verified).
On the Oric this is not necessary since video memory is just regular CPU RAM, exposing memory is more than enough and that would be provided by a basic implementation of the GDB protocol.
Indeed, which is why it is "relatively" easy, not just "easy". ;) |
There is a compile-time option: DEBUG_CPU_TRACE With this option, a call to mon_traceinst() is made from the m6502_inst() function. A first step may be to modify mon_traceinst() to send the data to a network socket. |
Correction: The circular buffer is actually sent to stdout, not to a log file.
|
Hi,
|
Hi @prb28 ! Thanks for the notice, this is definitely helpful. |
In the vscode extension the most important files for debugging are the socket communication proxy: https://github.com/prb28/vscode-amiga-assembly/blob/master/src/gdbProxy.ts (some parsing modifications must be done for registers, breakpoints, etc.) and the vscode interface: https://github.com/prb28/vscode-amiga-assembly/blob/master/src/fsUAEDebug.ts (at least you must modify the source line to memory offset match, and certainly more things...). |
Ok, thanks again, this indeed confirms that the VS Code interface is indeed fairly isolated and very easily adaptable. |
For the vscode interface there is the Language server protocol: https://microsoft.github.io/language-server-protocol/ , https://code.visualstudio.com/api/language-extensions/language-server-extension-guide. |
As mentioned in a post by Chema on the Defence Force forums, it would be very useful to be able to debug emulated Oric code from a full featured debugger (like Visual Studio or GDB) in addition to using Oricutron's internal debugger (cf this post: http://forum.defence-force.org/viewtopic.php?f=22&t=1001&start=90#p15147 and this one: http://forum.defence-force.org/viewtopic.php?p=18359#p18362).
Adding external debugger support can be done relatively easily by using the GDB serial protocol which allows any program to be controlled via a GDB-compatible debugger (Visual Studio supports that protocol for example, as does Visual Studio Code). This would allow people to debug their Oric programs using all the advanced features of their modern IDE debugger. (cf https://ftp.gnu.org/old-gnu/Manuals/gdb-5.1.1/html_node/gdb_125.html for details about that protocol).
As an example, a few people have been working on GDB support for the FS-UAE/Win-UAE Amiga emulator (FrodeSolheim/fs-uae#63) with good results and there does not seem to be any reason why this should not be possible with Oricutron.
Advantages:
The text was updated successfully, but these errors were encountered: