Вопрос

I am experimenting with Dart and libraries and I cannot seem to get a breakpoint to work in my library class.

I've created a library in lib/myLib/myLib.dart, defined a class there and set a breakpoint in the constructor. I construct this class from my main method, defined in web/test.dart. Breakpoints which are set in the main method are hit, but the breakpoints from the library are not hit. I am certain the code executes though, as i can step into the library's code from the main method.

Is this a known issue, or do i need to configure something? I am using Dart Editor version 1.0.0_r30798 and DartSDK version 1.0.0.10_r30798 on Windows 7 64-bit.

Это было полезно?

Решение

You are probably importing your own library like this:

import “package:mylib/lib.dart”;

If so, you should put your breakpoint in the files located under the “packages” folder in your project.

Alternatively, you can import your lib with a relative path:

import “../lib/lib.dart”;

Другие советы

I have sometimes issues with breakpoints. Either they get ignored or the execution halts at the breakpoint but instead of the file with the code a new window with an error message is opened in the Editor('file not found' or similar).

In such cases I use the Dartium integrated debugger whihc never let me down. F12 in Dartium > Editor dialog > choose 'no' > Dartium developer tools tab sources > open source from 127.0.0.1:3030 node > set breakpoint > start reload/execution with F5

Bubblewrap, can you create a small test case demonstrating the issue, and file a bug at dartbug.com/new, w/ the test case attached?

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top