Skip to content

Scripting Debugger issues #3471

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

Open
emilyploszaj opened this issue Apr 20, 2025 · 0 comments
Open

Scripting Debugger issues #3471

emilyploszaj opened this issue Apr 20, 2025 · 0 comments
Labels
feature:scripting Issues in the scripting subsystem
Milestone

Comments

@emilyploszaj
Copy link

Been trying out the debugging breakpoint APIs on the dev builds of mGBA and have notices two notable issues (which I think relates to an underlying issue)

  • If scripting is reset and another script is loaded, watching the same breakpoint will fail silently until the game and script are reloaded
  • If you restart the game or load a new one, all previous breakpoints will stop working (expected) and all future breakpoints fail to register (unexpected) returning -1.

I feel like this is something relating to the debug engine for scripting not being kept up to date with the game and not properly being kept in sync and cleared. I've fixed the first bug with the following, but I assume it's a very poor solution. The latter I've had no luck with.

src/core/scripting.c

void mScriptContextDetachCore(struct mScriptContext* context) {
	struct mScriptValue* value = HashTableLookup(&context->rootScope, "emu");
	if (!value) {
		return;
	}
	value = mScriptContextAccessWeakref(context, value);
	if (!value) {
		return;
	}

	struct mScriptCoreAdapter* adapter = value->value.opaque;

+	for (int i = 0; i < adapter->debugger.nextBreakpoint; i++) {
+		_mScriptCoreAdapterClearBreakpoint(adapter, i);
+	}
@endrift endrift added the feature:scripting Issues in the scripting subsystem label Apr 28, 2025
@endrift endrift added this to the mGBA 0.11.0 milestone Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:scripting Issues in the scripting subsystem
Projects
None yet
Development

No branches or pull requests

2 participants