question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Breakpoints in Dart SDK code are not hit

See original GitHub issue

I tried to put breakpoints in Dart SDK code but those breakpoints are ignored.

To reproduce this I setup an environment with :

  • A fresh SDK installation : Dart SDK version: 2.15.0-68.0.dev (dev) (Wed Sep 1 05:51:32 2021 -0700) on "linux_x64"
  • A fresh Dart project created from DartCode command Dart: New Project and selecting simple-console template
  • Try to put a breakpoint in print source code

I used two ways to put this breakpoint : 1 - Using ‘Go to definition’ and add the breakpoint 2 - Launching a debug session and ‘Step into’ to reach Dart SDK source code and add the breakpoint

Two breakpoints were created with different paths, neither works : BreakpointsList

DartCode debugging logs : Dart-Code-Log-2021-08-05 13-41-24.txt

Corresponding session in video : https://user-images.githubusercontent.com/840911/132003058-ce293e04-b9d7-4642-bc9e-2889701ea086.mp4

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:26 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
DanTupcommented, Aug 25, 2022

This issue has been fixed for some upcoming releases. I tested it today using the current beta version of the Dart SDK (2.18.0), the pre-release v3.47.20220808 version of the Dart extension, and with the dart.previewSdkDaps: true setting.

When using all of these, the Dart SDK libraryes (such as dart:core) are not mapped back to your local SDK sources (the same ones you get to using Go-to-Definition in the editor), and breakpoints set in those files will be mapped over to dart:core by the debug adapter.

Screenshot 2022-08-25 at 11 55 55

Some of these pieces are not released in stable releases yet, and the SDK DAPs will be a gradual roll out over the coming releases (although you can opt-in explicitly with the dart.previewSdkDaps: true setting).

Please file issues if you still have issues with this once you have confirmed you’re on:

  • = v3.47.20220808 of the Dart extension

  • = v2.18.0-271.8.beta of the Dart SDK (or a Flutter SDK that includes this version)

  • The dart.previewSdkDaps setting set to true, or you have confirmed that you’ve been enabled automatically as part of the gradual rollout (this will include the text “Running SDK DAP” in the log opened by the Dart: Open Extension Log command).
0reactions
DanTupcommented, Aug 30, 2022

I noticed today that this fix does not entirely work when running Flutter apps - they return a different org-darlang-app:/// URI to the Dart SDK.

I’ve filed https://github.com/Dart-Code/Dart-Code/issues/4128 to track this, and https://github.com/dart-lang/sdk/issues/49863 to find out if it’s a bug, and if not exactly what the mapping rules are.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VsCode is not stopping on breakpoints - Flutter - Stack Overflow
My Dart SDK was not linked to the remote repository and was outdated so this setting was not working properly. This is done...
Read more >
v3.48 - Dart Code - Dart & Flutter support for Visual Studio Code
#4074: Adding breakpoints in files that will not be hit because of debugger settings will now show a prompt even if debugger settings...
Read more >
Debugging Flutter apps
DevTools; Setting breakpoints; The Dart analyzer; Logging; Debugging application layers; Debug mode assertions; Debugging animations; Measuring app startup ...
Read more >
Dart | IntelliJ IDEA Documentation - JetBrains
Configure and set breakpoints in the Dart code. Initiate a debugging session: choose the created run configuration from the Edit configurations ...
Read more >
#3 - How to CREATE, RUN & DEBUG a Dart Project (Terminal ...
Hi there! In this video I'll show you multiple ways on how to create, run and debug a Dart Project. All animations were...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found