-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Error editing memory of trace in emulator #7413
Comments
@hexagonal-sun Just tried your suggestion in the current build and seemed to have worked, so possibly it has been fixed or possibly I'm doing slightly different than you did. My steps:
Not much of the code in your stack trace has changed in the last year, so I have a feeling something I'm doing differs slightly from what you're doing. I will continue to play around, fo course, to see if I can re-create your error. Maybe try my variations above - see if you still see the error? |
@d-millar Thanks for your reply! I just tried your steps and that didn't cause the error. So it seems as though it's related to closing the debugger and then opening the program in the emulator tool. Note that if you close ghidra completely and re-open it the issue is fixed. You need to perform the above steps without closing ghidra completely. I've also verified that it's nothing to do with the program that I'm reversing. I've just replicated it with Hope that helps! |
Ah, that definitely helps - hopefully, i’ll be able to recreate this later today and knock out a fix. By the by, in case it wasn’t clear, you don’t have to close anything to get the trace, i.e. the trace is active and updated all the time. You can close the connection, if you prefer not to have the debugger running, and the residual trace should be (let me know if i’m wrong about this) identical to the trace you’re getting by closing and re-opening. |
I've located the problem (going to defer to @nsadeveloper789 for the solution), but should be a relatively simple fix. You're correct it's closing the tool that causes the problem - leaves a stale reference in the memory handler. As noted, the workaround for now is probably not to close the tool or, if you have to, restart Ghidra. Thanks for pointing this out! |
FWIW, there is no need to close the Debugger to re-open in the Emulator. The Emulator is just the Debugger without any connectors. If you need to create/save a trace explicitly, use the menus: Debugger → Save Trace. The flaw is pretty obvious (now that we've seen it happen), and I think the fix will be easy. |
Eh. Not so easy. We could develop another workaround, but I don't think it's worth it given the existing workarounds. The whole We'll need some time with this one. |
Describe the bug
When I try to modify the memory of a trace that I've taken in gdb in the emulator, I get an error. Backtrace:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
The memory should be editable, or if editing the memory of traces isn't supported, a more appropriate error should be shown.
Environment (please complete the following information):
Build Date: 2024-Nov-05 1643 EST
Ghidra Version: 11.2.1
Java Home: /nix/store/j3m8b0ddrb0jp0y8d3a31l2lw810y6wv-openjdk-23.0.1+11/lib/openjdk
JVM Version: N/A 23.0.1
OS: Linux 6.13.0 amd64 (NixOS)
The text was updated successfully, but these errors were encountered: