mirror of
https://github.com/janet-lang/janet
synced 2024-11-25 09:47:17 +00:00
Fix debug/break search algorithm.
This commit is contained in:
parent
9d020c3ec5
commit
45dfc7cc96
@ -74,7 +74,8 @@ void janet_debug_find(
|
|||||||
int32_t line = def->sourcemap[i].line;
|
int32_t line = def->sourcemap[i].line;
|
||||||
int32_t column = def->sourcemap[i].column;
|
int32_t column = def->sourcemap[i].column;
|
||||||
if (line <= sourceLine && line >= best_line) {
|
if (line <= sourceLine && line >= best_line) {
|
||||||
if (column <= sourceColumn && column > best_column) {
|
if (column <= sourceColumn &&
|
||||||
|
(line > best_line || column > best_column)) {
|
||||||
best_line = line;
|
best_line = line;
|
||||||
best_column = column;
|
best_column = column;
|
||||||
besti = i;
|
besti = i;
|
||||||
@ -89,6 +90,9 @@ void janet_debug_find(
|
|||||||
if (best_def) {
|
if (best_def) {
|
||||||
*def_out = best_def;
|
*def_out = best_def;
|
||||||
*pc_out = besti;
|
*pc_out = besti;
|
||||||
|
if (best_def->name) {
|
||||||
|
janet_printf("name: %S\n", best_def->name);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
janet_panic("could not find breakpoint");
|
janet_panic("could not find breakpoint");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user