-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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] debugger: Memory breakpoints #9621
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
This feature would be immensely useful, seconded. Especially if it would support different kinds of bp's like CE, thinking of read/write/access here. Bumping the thread to signal the need. |
Registering my interest in this and bumping. Using CE is a bit of a pain, so it'd be nice to have that functionality natively built-in. |
I want to try to implement "software" memory breakpoints, instead of relying on x86 limited hardware. Before screaming "NOOO IT WILL BE TOO SLOW" I want to actually analyse its impact on overall performance. Cross-platform "sparse memory" (usually called overcommit memory) support (rpcs3_vm) was made for this purpose. |
what about using CCAPI? |
Unless we port RPCS3 to a real PS3, I do not see any use in this. |
Not sure what sparse memory has to do with implementing this feature, could you explain? Sounds interesting. Fwiw I think the x86 hardware limitation of 4 breakpoints at a time per thread is fine for the vast majority of use cases. But I suppose the decision is up to whoever wants to actually do it. |
Btw just in case anything can be salvaged (doubtful), there is old/slow support for this for Interpreter here: VelocityRa@f787601 |
When hw breakpoint is hit, the overhead of exception handling is pretty high. Only in simple use cases it doesn't matter. Software breakpoints can avoid this overhead in theory, thus enabling fast conditional breakpoints and similar advanced features which could otherwise be either slow or not working due to disproportional overhead. Sparse memory exploits the typical implementation detail of memory overcommitment: memory pages appear as zeros until written, but these zeros aren't occupying physical memory yet, mirroring a single zero page instead. It occupies much less RAM when unused. It should avoid cache miss on random access in most cases, or at least reduce it to TLB miss. Few instructions fetch either zero or a handler address from "sparse memory" for given PS3 VM address being accessed. It's possible to implement in various ways (test + cc jmp, or unconditional call of the dummy handler), I don't know exactly what approach is optimal here, need to test it. Finally, it seems possible to implement classic execution breakpoints using the same approach, and make them work with PPU LLVM without tricky patching. |
Integrated this into the latest code, it did require some changes, but I got it to compile. Unfortunately, RPCS3 crashes immediately when starting up a game and trying to figure out what's going on with zero knowledge of this project isn't going to be easy. Edit: managed to get things running, possibly incremental linking that messed something up. Quality wise, I wouldn't merge this back, the g_breakpoint_handler is a klutz and checking the map on every load/store instruction isn't very efficient. |
@BlackStar-EoP: can you share a build of your fork? I'd like to try it and see if i can use it to make some cheats. |
Here it is, be sure to set the CPU to interpreter |
i think i also need the correct dll files, all games fails to boot with compilation errors... |
Hey eadmaster, so sorry, I completely forgot to respond to your message. For the DLLs, this should be good, usually what I do is just replace the rpcs3 executable with my own and the whole thing starts. I also hacked in a memory dump in the memory viewer that can dump a range of memory into a file :) |
Alongside #9002, lack of breakpoint types supported by the debugger.
The text was updated successfully, but these errors were encountered: