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

Breakpoints and app restarts #56

Open
zspitzer opened this issue Jul 13, 2024 · 5 comments
Open

Breakpoints and app restarts #56

zspitzer opened this issue Jul 13, 2024 · 5 comments

Comments

@zspitzer
Copy link
Contributor

One issue I've noticed is seeing breakpoints blocking app restarts when using a framework

It's less painful on windows, as vs code gets the lovely red outline when paused on a breakpoint in the start menu, unlike on Mac

Anyway, I was wondering if there is a way to clear paused breakpoints from lucee?

Conversely being able to trigger a breakpoint from cfml code would also be unreal, but I'm not sure if that's remotely (sic) possible!

Googling this is rather challenging

@softwareCobbler
Copy link
Owner

softwareCobbler commented Jul 13, 2024

Anyway, I was wondering if there is a way to clear paused breakpoints from lucee?

Not at the moment, but I guess it might look something like

createObject("java", "luceedebug.Hypothetical").resumeAll()

I'm not 100% if the IDE supports being notified of thread resumption though -- usually it's the IDE telling the thread to resume, not the JVM telling the IDE it has resumed.

Conversely being able to trigger a breakpoint from cfml code would also be unreal, but I'm not sure if that's remotely (sic) possible!

I think you're talking about a debugger statement

My current workaround for this is to add a debugger-esque dummy statement and set a breakpoint on it, I always use 0+0; (just 0; seems to get optimized away), so like

someCode();
0+0; // set breakpoint on this
debugger; // ideally one could do
otherCode();

Adding a debugger statement might need some support from Lucee internals to parse it, and to add a mechanism to register a callback so statement invocation can jump into luceedebug. Also a key point is that the statement should be a no-op if there is no debugger, otherwise you leave a debugger statement in and crash in production (0+0 satsifies this rule).

@zspitzer
Copy link
Contributor Author

ohhh, 0+0; is a nice trick!

@michaeloffner what can we do here to help make this debugger support work.

If there's no debugger attached, Lucee could just ignore the debugger tag / directive?

@pibica
Copy link
Contributor

pibica commented Aug 10, 2024

ohhh, 0+0; is a nice trick!

I'm unable to use it:

<cfscript>
writeOutput("before<br>");
0+0;
writeOutput("after");
</cfscript>

I'm able to set in vscode a breakpoint on first line and it works; but the debugger does not stop automagically on line "0+0";

luceedebug 2.0.12
lucee 6.1.0.243
jdk 11.0.24 (Eclipse Adoptium) 64bit
windows

@softwareCobbler
Copy link
Owner

I can't reproduce the above locally; if you can create a reproduction via a docker container I will look into it.

@pibica
Copy link
Contributor

pibica commented Aug 20, 2024

I can't reproduce the above locally; if you can create a reproduction via a docker container I will look into it.

I've created one:
https://github.com/pibica/luceedebug-bug-repo
http://localhost:8888/issue-56.cfm

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

3 participants