-
-
Notifications
You must be signed in to change notification settings - Fork 797
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
Towards a comprehensive debug suite #1749
Comments
mGBA already supports acting as a GDB server. Would be great if it could also integrate with modern reverse engineering frameworks like Radare2 and Ghidra. Wouldn't this be more efficient compared to every emulator independently developing their own debugging tools? |
I will admit I am not sure how to use mGBA's GDB functionality. However, my impression is that the implementation is not ideal. Certainly, I will claim it's much easier to use a well-integrated debugging interface where standard functionalities are laid out in an intuitive way, though it might not be as powerful as GBD. It is also, as I understand, the ultimate goal for mGBA's debugging tools. I welcome the idea of integrating static analysis tools. Something like that seems ambitious enough to be an entirely separate project from the short-term goals for mGBA's debugger; integrating tools like this well is not trivial. Additionally, when I spent some time using Ghidra, I found the lack of handling for virtual method tables to be a severe limitation (though I may have missed something, but my ideal setup didn't seem possible, making it a severe limitation; of course, I could eventually write my own if none exists, as I noted in the previous issue). In any case, it's work someone has to do, so progress will largely be shaped by the development priorities of those actually working on mGBA. |
The Debugger in EmuHawk uses external see also TASEmulators/BizHawk#2312 |
Ok? I've already written a disassembler. And forcing people to use a third-party program with its own release schedule when I've already got progress towards it on my own debugger doesn't really sound like a solution. |
BizHawk's debugger is super janky and broken in my experience. I've never gotten it to work consistently or productively. mGBA seems to have a better debugging infrastructure than BizHawk's current stuff. |
People are already using mgba with Ghidra in order to reverse engineer GBA games. Looks like it already implements every requirement described in this issue. Not sure about the nice-to-have features though. It should be possible though. |
One of the goals for mGBA is a comprehensive debug suite. I would value this feature greatly, and have some ideas.
I separate this into three lists: "required" and "nice to have", and "theoretical". Hopefully my classifications are sensible; I base them off of having spent time using the debuggers of other emulators, and then spending a fair bit of time attempting to use mGBA's debugger.
One may notice I also filed #1117, but this current issue is a result of significantly more experience using emulator debuggers in practice, and has a slightly different (and hopefully more focused) scope than the previous issue.
For me, a comprehensive debug suite requires:
Step into
,Step over
,Step out
functionalities with keyboard shortcuts. Many emulators use the function keys for this functionality, but those are already reserved for savestates here, so I'm not sure what the best default option (maybe replace savestate shortcuts, as debugger shortcuts are imo higher priority? At the very least, allow the user to rebind the shortcuts).Return from $xxxxxxxx
labels on the return addresses, preferrably with proper handling of virtual method table jumps).Some features that would be nice to have:
trace
).Some theoretical featueres I don't really see elsewhere:
bx r14
. In rare cases, these will fail, but it would work well enough in most cases.This is by no means a comprehensive list of what I'd like to see it the debug suite. There are many potential features, but I do not want to make this post unreadable, and I feel like my effort in composing such a post would be better spent by attempting to implement such features myself.
The text was updated successfully, but these errors were encountered: