Skip to content
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

Trouble using breakpoint scripting API #3046

Closed
v1993 opened this issue Oct 9, 2023 · 1 comment
Closed

Trouble using breakpoint scripting API #3046

v1993 opened this issue Oct 9, 2023 · 1 comment

Comments

@v1993
Copy link

v1993 commented Oct 9, 2023

I'd like to try out breakpoint scripting API introduced in development versions of mGBA but can't get it to work for the life of mine.

First of all, setBreakpoint returns -1 , apparently hitting this, unless I open a debugger window and run something in it before executing setBreakpoint. But even then I can't get breakpoints to work - they just don't trigger, and if I manually set one from debugger console (break/t), the emulation hangs upon hitting it and only resumes once I reset the script window. I've also tried changing breakpoint type in _mScriptCoreAdapterSetBreakpoint to BREAKPOINT_SOFTWARE, but that aborts with core dump.

Code I run in scripting console to try and set breakpoint:

print(emu:setBreakpoint(function() print('Beakpoint hit') end, 0x80045a8))

For the record I'm testing this on commit ce374b1, GBA game Metroid Fusion (USA) with breakpoint at 0x80045a8 (THUMB code). Would greatly appreciate any help.

P.S.: what does the third segment argument do for setBreakpoint? I can't find any explanation for it and it does not appear to refer to memory domain either.

@v1993
Copy link
Author

v1993 commented Oct 10, 2023

Regarding debugger initialization: it looks like it's up to frontend to set up a debugger and neither Qt nor SDL do it unless either GDB or built-in debugger have been used/enabled. This poses a problem to scripts since they have no way to request a debugger to be set up for current program. It also seems that solving this would require some refactoring, as setup/teardown of debugger is currently completely within responsibility of frontends and thus can't be easily added into scripting API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant