vshaxe / hashlink-debugger

Visual Studio Code Debugger for Haxe/HashLink applications
https://hashlink.haxe.org/
MIT License
57 stars 23 forks source link

Make backtrace show previous line if triggered by watch #129

Closed yuxiaomao closed 8 months ago

yuxiaomao commented 8 months ago

When setting a data watch point for y in the following code, the debugger will first "stop" at line 5 instead of line 4, which is a little bit confusing as it is the line 4 which modified y.

static var y = 0;
static function main() {
    trace(y); // <- watch y here and continue
    y = 15 * 15;
    trace(y); // <- break has a backtrace point at this line instead of previous line
}

This PR make backtrace return line 4 instead of line 5 in case of watch.