简体   繁体   中英

Are breakpoints not working as they should in DartEditor?

I'm getting some unexpected behaviour in the most recent Dart editor (version 0.4.0_r18915).

I have this minimal command line app that was intended to either take a command line argument or not and print a hello -somenoe- message. The application works just fine. But the debuggins fails to stop at the breakpoints set inside each of the if statement bodies. (I wanted to look at the state of the application weather the options.arguments.isEmpty was true or false)

var person;

main(){
    var options = new Options();
    if(options.arguments.isEmpty){
        person = "someone who forgot to pass a command-line argument";
    } else {
        person = options.arguments[0];
    }
    print("Hello, $person!");

}

Debugger will stop at breakpoints in other lines but not in:

person = "someone who forgot to pass a command-line argument";

or in:

person = options.arguments[0];

Yes, file a bug. My suspicion is that the debugger can only stop at what's called a "safepoint" and that the assignment of a constant to a variable doesn't create one. Adding some line above it, like print("breakpoint"); should help if that's the case. But I've also seen other problems with breakpoints not firing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM