Discussion:
[dart-misc] Debugging dart - preferences for debugging pub packages/SDK code?
Danny Tuppeny
2016-09-16 11:38:49 UTC
Permalink
In C#, by default, the debugger only steps through code I've written; it
excludes:

- .NET Framework code
- Third party packages (eg. NuGet)
- Code marked as generated

There are some options for debugging through framework/external packages
but to me the defaults seem pretty sane. Currently Dart Code will step
through everything and it bugs me, so I'm planning on adding options to
allow you to individually enable debugging SDK and external libraries.

To me, it seems like the best default would be to have both of these
options off (so the debugger will only step through your own code), but
possibly this is because it's what I'm used to. I don't know if other Dart
editors have options for these but I suspect most Dart devs are probably
used to stepping through the SDK/etc. by default.

So, I'm after opinions - if you use the Dart debugger, what do you think is
the best default? Is stepping through the SDK ever useful or would you
rather it was treated like external native code? What about pub packages
you've added?
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Lex Berezhny
2016-09-16 12:29:48 UTC
Permalink
That's an interesting perspective (I assume from Visual Studio?). To be
honest, until your email, I had never considered my own code and any
libraries that I depend on as somehow separate and I've been debugging code
for at least 10 years :-)

Most of the time I am debugging something to find a bug and bugs can appear
anywhere; sometimes even in 3rd party code. So, I think it makes sense to
step through all code that's in the path to fix a particular problem
regardless if the code is mine or someone else's.

I would suggest instead of automatically isolating yourself from other
people's code try:

1. Using step-over instead of step-into and then you can skip going into
other people's code.

2. If you are using a decent IDE: instead of stepping over every line just
click the line you want to go to and then do "run to cursor".

3. Use conditional breakpoints.

I think mastering your IDE would be much more beneficial for long term
productivity than trying to isolate yourself from other people's code which
may actually have the bug you're looking for...

- lex
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Filipe Morgado
2016-09-16 13:07:34 UTC
Permalink
+1

I use step-over on everything I don't want to step-into, be it other libs
or my own code.
Post by Lex Berezhny
That's an interesting perspective (I assume from Visual Studio?). To be
honest, until your email, I had never considered my own code and any
libraries that I depend on as somehow separate and I've been debugging code
for at least 10 years :-)
Most of the time I am debugging something to find a bug and bugs can
appear anywhere; sometimes even in 3rd party code. So, I think it makes
sense to step through all code that's in the path to fix a particular
problem regardless if the code is mine or someone else's.
I would suggest instead of automatically isolating yourself from other
1. Using step-over instead of step-into and then you can skip going into
other people's code.
2. If you are using a decent IDE: instead of stepping over every line just
click the line you want to go to and then do "run to cursor".
3. Use conditional breakpoints.
I think mastering your IDE would be much more beneficial for long term
productivity than trying to isolate yourself from other people's code which
may actually have the bug you're looking for...
- lex
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Danny Tuppeny
2016-09-16 13:17:27 UTC
Permalink
Post by Lex Berezhny
That's an interesting perspective (I assume from Visual Studio?). To be
honest, until your email, I had never considered my own code and any
libraries that I depend on as somehow separate and I've been debugging code
for at least 10 years :-)
Not it matters at all but I've been debugging much longer than that :-)


Most of the time I am debugging something to find a bug and bugs can appear
Post by Lex Berezhny
anywhere; sometimes even in 3rd party code. So, I think it makes sense to
step through all code that's in the path to fix a particular problem
regardless if the code is mine or someone else's.
Sure; I'm not under some illusion that external code is perfect; but "code
I'm currently writing/thinking about" is going to be much more buggy than
"a release quality SDK from Google"! And stepping through the same .forEach
SDK method many times a day is pointless; I'm writing/testing/debugging my
code, and I'm pretty confident in the external code (mostly).

To me, there's not much difference between the Dart SDK and the native code
it calls - it's of high quality and being tested by a lot of people. You
wouldn't expect to step down into the native code, yet there may be bugs in
there!
Post by Lex Berezhny
I would suggest instead of automatically isolating yourself from other
1. Using step-over instead of step-into and then you can skip going into
other people's code.
2. If you are using a decent IDE: instead of stepping over every line just
click the line you want to go to and then do "run to cursor".
3. Use conditional breakpoints.
I think mastering your IDE would be much more beneficial for long term
productivity than trying to isolate yourself from other people's code which
may actually have the bug you're looking for...
I know how to use these features; I spend a lot of time every day using
them. However they don't all work well in all cases. There's a reason
Visual Studio has the default it does and that Chrome added a feature to do
the same thing in Javascript
<https://divshot.com/blog/tips-and-tricks/ignoring-library-code-while-debugging-in-chrome/>
:-)

To be clear, I'm not asking for a feature here, I am implementing the
IDE/debugger integration for Dart Code
<https://marketplace.visualstudio.com/items?itemName=DanTup.dart-code>. I'm
adding an option to support this feature; I'm just after opinions on what
the default should be. If this concept is alien to all Dart devs, I'll
leave the default as stepping through everything; it will definitely be an
option in Dart Code though! :-)

Danny
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Lex Berezhny
2016-09-16 13:32:03 UTC
Permalink
Post by Danny Tuppeny
To be clear, I'm not asking for a feature here, I am implementing the
IDE/debugger integration for Dart Code
<https://marketplace.visualstudio.com/items?itemName=DanTup.dart-code>.
I'm adding an option to support this feature; I'm just after opinions on
what the default should be. If this concept is alien to all Dart devs, I'll
leave the default as stepping through everything; it will definitely be an
option in Dart Code though! :-)
Since Dart hasn't been around that long I think many of us are bringing our
habits from other languages. In my case that would be Python. I've only
been working with Dart full time for last two years (using an IntelliJ
based IDE). There is probably not going to be a single "dart developer"
profile/default that would make sense here.

On the other hand... since you are implementing plugin for Visual Studio
then I think it's relatively safe to assume that other developers using
your plugin maybe more familiar with Visual Studio defaults in C# than what
I or another non-VS user may be familiar with.

It would probably make more sense to poll the VS community instead of the
broad Dart community, I suspect the consensus with VS folks would be to
stick to existing VS conventions for all language implementations.

- lex
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Danny Tuppeny
2016-09-16 13:37:52 UTC
Permalink
Post by Lex Berezhny
Post by Danny Tuppeny
To be clear, I'm not asking for a feature here, I am implementing the
IDE/debugger integration for Dart Code
<https://marketplace.visualstudio.com/items?itemName=DanTup.dart-code>.
I'm adding an option to support this feature; I'm just after opinions on
what the default should be. If this concept is alien to all Dart devs, I'll
leave the default as stepping through everything; it will definitely be an
option in Dart Code though! :-)
Since Dart hasn't been around that long I think many of us are bringing
our habits from other languages. In my case that would be Python. I've only
been working with Dart full time for last two years (using an IntelliJ
based IDE). There is probably not going to be a single "dart developer"
profile/default that would make sense here.
Sure, I'm just trying to get an opinion on whether there's an obvious
choice. If most Dart devs are used to debugging everything, I'm happy for
the default to not be what I would use. However, there was a chance that
Dart devs would say "that would be amazing; I'm sick of stepping into
framework code", hence the request for opinions.
Post by Lex Berezhny
On the other hand... since you are implementing plugin for Visual Studio
then I think it's relatively safe to assume that other developers using
your plugin maybe more familiar with Visual Studio defaults in C# than what
I or another non-VS user may be familiar with.
It would probably make more sense to poll the VS community instead of the
broad Dart community, I suspect the consensus with VS folks would be to
stick to existing VS conventions for all language implementations.
My extension is aimed at Dart Developers, not Visual Studio users (it's
actually an extension for Visual Studio Code, not Fat VS), so here seems
most appropriate to me - it doesn't matter what a C# dev prefers. The
people I want to use my extension are the very people in this group that
may currently be using IntelliJ, Atom, etc.. :-)
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Mike
2016-09-16 17:18:14 UTC
Permalink
For what its worth, I think an option to skip SDK code would be very helpful and I'd use it as my default.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Günter Zöchbauer
2016-09-17 11:17:57 UTC
Permalink
I was sure I created a feature request for this already years ago, but
can't find it.
An option to skip SDK code and sometimes even code of package dependencies
would be very helpful.
Post by Mike
For what its worth, I think an option to skip SDK code would be very
helpful and I'd use it as my default.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Danny Tuppeny
2016-09-17 11:24:54 UTC
Permalink
Post by Günter Zöchbauer
I was sure I created a feature request for this already years ago, but
can't find it.
An option to skip SDK code and sometimes even code of package dependencies
would be very helpful.
My plan is to have options for both :-)

This thread was to gather opinions on whether this should be the default or
not - how much do you think you would have this enabled/disabled?
Unfortunately switching it on/off during debugging may not be easy, so
you'd likely need to have it set before your debugging session.

It turns out the support for this (setLibraryDebuggable) isn't working
correctly in the current Dart SDK, so I'm currently blocked on adding this
(I'm not sure whether this means no other IDEs have this?), but as soon as
there's a dev version with a fix I can get back to it.

I suspect I'll leave it as stepping through all code by default, though I'm
still interesting in opinions in case most devs would rather
skip-by-default and opt-in if they feel they need to debug SDK/library
code.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Günter Zöchbauer
2016-09-17 12:01:58 UTC
Permalink
I wouldn't care if I need to restart.
By default I don't want to step into SDK code.
Usually the bug is in my own code (no matter how sure I am about having
done everything correctly) ;-)
Post by Danny Tuppeny
Post by Günter Zöchbauer
I was sure I created a feature request for this already years ago, but
can't find it.
An option to skip SDK code and sometimes even code of package
dependencies would be very helpful.
My plan is to have options for both :-)
This thread was to gather opinions on whether this should be the default
or not - how much do you think you would have this enabled/disabled?
Unfortunately switching it on/off during debugging may not be easy, so
you'd likely need to have it set before your debugging session.
It turns out the support for this (setLibraryDebuggable) isn't working
correctly in the current Dart SDK, so I'm currently blocked on adding this
(I'm not sure whether this means no other IDEs have this?), but as soon as
there's a dev version with a fix I can get back to it.
I suspect I'll leave it as stepping through all code by default, though
I'm still interesting in opinions in case most devs would rather
skip-by-default and opt-in if they feel they need to debug SDK/library
code.
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Danny Tuppeny
2016-09-17 12:54:31 UTC
Permalink
Post by Günter Zöchbauer
I wouldn't care if I need to restart.
By default I don't want to step into SDK code.
Usually the bug is in my own code (no matter how sure I am about having
done everything correctly) ;-)
This matches my thoughts exactly! But I'm still no closer to picking a
default... I think I know of three people that would prefer not to step
into SDK and the same that would... I expected most to want the current
behaviour!

I don't mind not doing my preference, but if opinions are divided I'm now
also thinking not stepping into external code is the most
beginner-friendly. Picking defaults is hard :D
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Danny Tuppeny
2016-09-17 12:55:05 UTC
Permalink
I posted a poll on Twitter if anyone wants to anonymously give their
preference.. If you have Dart devs following; please RT =)

https://twitter.com/DartVSCode/status/777128085766467585
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Loading...