-
Notifications
You must be signed in to change notification settings - Fork 93
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
Built-in debugger server #270
Comments
It sounds like what you want is a way to debug things running with a simulator and not the simulator itself which can already be debugged directly with normal software tools. If that is true, then gdbstub could be used to interface and control the contents of simulators using possibly some simulator specific code and the simh frontpanel API. If you want to explore this and you actually have a use case for one or more simulators, I'll be glad to work with your to put something together. Someone's long ago request for something like this was one of the inspirations for implementing the frontpanel API. Feel free to contact me here or offline at mark@infocomm.com |
A number of simulators already have a breakpoint facility. So with that and basic things like register and memory access you have pretty much all the things needed for GDB. The stub protocol is quite easy. |
@XVilka: Can you write up an initial design? Are you leveraging the gdbstub protocol with existing SIMH internals? Or a whole new debugger? |
Yes. Leveraging GDBRemote protocol looks like easiest and proven solution, even if the GDB itself might not support the target architecture. As for STABS we plan to implement it in Rizin: rizinorg/rizin#3578 |
I can see how the Rizin effort might be useful, e.g., reverse engineering VAX diagnostics or PDP-11 diagnostics. There's a little more to this design that needs expansion, though. @pkoning2, @sethm: @XVilka's proposal adds the GDB remote debugging protocol as a frontend to SIMH. That would make it possible for the Rizin tools to reverse engineer VAX diagnostics (or the 3b2 diags) and potentially recover them as C code or as documented assembler sources. @XVilka: STABS is a debugging format; I'm not conceptually connecting STABS to the GDB remote protocol. Would it be used to augment the reverse engineering process by tracking symbolic info associated with the image being reverse engineered? Where would that STABS info get stored? Also, adding an alternate frontend to SIMH suggests fixing the SDL weirdness. SDL should always be the main thread (implying that the SIMH command line lives in its own thread), per the SDL design, not just for macOS and BESM6. That would result in a more consistent compile methodology, vice exceptions for platforms and specific simulators. |
The reason I mentioned STABS is that the debugger wants a binary format that includes debug data, and the compiler and/or assembler needs to generate that. STABS is the old format which is rapidly disappearing, ELF with DWARF is the new one. The issue is that some GCC targets -- pdp11 at least -- is only STABS and that was actually removed from GCC recently, so the current GCC still supports pdp11 but without debug data. pdp11-elf is doable but not done yet. For VAX it is, I believe. |
Many emulators support ways to debug their guests using more suitable tools - GDB, LLDB, EDB, WinDbg, IDA Pro, etc.
Implementing something like gdbstub, just like QEMU does this, will allow remote debugger connection, e.g. GDB itself, or something else:
The text was updated successfully, but these errors were encountered: