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

Allow for AwaitDebugger but don't pause on first #589

Open
BinarySpike opened this issue Aug 7, 2024 · 3 comments
Open

Allow for AwaitDebugger but don't pause on first #589

BinarySpike opened this issue Aug 7, 2024 · 3 comments
Assignees

Comments

@BinarySpike
Copy link

For performance/quality-of-life reasons, I'd like to wait for a debugger to attach, but not pause directly after.
See: https://github.com/microsoft/ClearScript/blob/1ba26876fc9dc1dd290fac657914cc1a8cf4c487/ClearScriptV8/V8IsolateImpl.cpp#L737C1-L737C25

Would adding a flag and skipping the identified line be a reasonable way to implement this?

@ClearScriptLib
Copy link
Collaborator

Hi @BinarySpike,

I'd like to wait for a debugger to attach, but not pause directly after.

Interesting. Can you describe a situation in which this capability would be useful? To put it another way, why is AwaitDebuggerAndPause problematic in your case?

Would adding a flag and skipping the identified line be a reasonable way to implement this?

Well, we wouldn't want to make the API too clunky – e.g., AwaitDebuggerAndPause | DontActuallyPause 😅. Perhaps we could deprecate AwaitDebuggerAndPause and replace it with a pair of new flags.

Thanks!

@wysisoft
Copy link

@BinarySpike Hey Nathan small world its Todd, what you using ClearScript for?

@BinarySpike
Copy link
Author

why is AwaitDebuggerAndPause problematic in your case?

Two issues, first if I Thread.Sleep(5000) before the execution, the debugger attaches during the sleep and the execution never pauses. Second, if I put a breakpoint deep in my code, it pauses at the beginning and I have to hit continue to reach the next breakpoint—this is just really annoying.

replace it with a pair of new flags.

That would be my preference. Seems the logical solution.

@BinarySpike Hey Nathan small world its Todd, what you using ClearScript for?

@wysisoft ! Mostly looking at it for a hobby project. However, I'm looking at exposing a partial API of our application layer so that we can implement configurable business logic. We have a system that manages tons of files & folders and each tenant uses the system differently. Being able to deploy a tenant, then build them a script where they can enter properties, then hit a button and the script creates files, creates folders, and applies permissions based on their specific needs would be chefs kiss 😗👌

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

No branches or pull requests

3 participants