How do I set breakpoints everywhere?

I am debugging a bunch of nodejs apps. Javascript doesn't exactly run sequentially, with all the async-awaits. So I have this weird workflow where I initially set breakpoints everywhere, first on every file, and then, once the file is hit, on every function within the file, then on lambdas within the function, etc. Then I gradually delete them, narrowing down on what I need.

Two questoins.

1. Am I crazy? Is there a superior alternative? 

2. Regardless, is there a way to automate this process? 

 

 

0

there is no way to automate this; did you try stepping through the code instead of adding breakpoints to each and every line?

0

Not always feasible. When you step out of an async function, you get into unpredictable places. Sometimes into system libraries.

It doesn't help that I am working in nestjs, an IoC framework. Here is a "hello-world" app. Purple is my code that I want to step through, white and yellow is everything else.

 

 

Granted, I can toggle the "filter" button, but still, trying to step through asynchronous user code is like finding pieces of a broken needle in a haystack.

Unless a methodology exists that I am not aware of, I find it to be much faster to just set breakpoint on the first line on every user file, and then on the first line of every function. Not on every line of code.

But perhaps there are gotchas that I am not aware of? 

0

请先登录再写评论。