Mercurial > vim
comparison src/vim9execute.c @ 25719:154663508d9b v8.2.3395
patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Commit: https://github.com/vim/vim/commit/26a4484da20039b61f18d3565a4b4339c4d1f7e3
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 2 18:49:06 2021 +0200
patch 8.2.3395: Vim9: expression breakpoint not checked in :def function
Problem: Vim9: expression breakpoint not checked in :def function.
Solution: Always compile a function for debugging if there is an expression
breakpoint. (closes #8803)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 02 Sep 2021 19:00:04 +0200 |
parents | f8bcd21e6e24 |
children | f31cf0388eab |
comparison
equal
deleted
inserted
replaced
25718:c3adc383b30f | 25719:154663508d9b |
---|---|
1481 return STACK_TV(ectx->ec_frame_idx - 1); | 1481 return STACK_TV(ectx->ec_frame_idx - 1); |
1482 | 1482 |
1483 return NULL; | 1483 return NULL; |
1484 } | 1484 } |
1485 | 1485 |
1486 /* | |
1487 * Return TRUE if there might be a breakpoint in "ufunc", which is when a | |
1488 * breakpoint was set in that function or when there is any expression. | |
1489 */ | |
1490 int | |
1491 may_break_in_function(ufunc_T *ufunc) | |
1492 { | |
1493 return ufunc->uf_has_breakpoint || debug_has_expr_breakpoint(); | |
1494 } | |
1495 | |
1486 static void | 1496 static void |
1487 handle_debug(isn_T *iptr, ectx_T *ectx) | 1497 handle_debug(isn_T *iptr, ectx_T *ectx) |
1488 { | 1498 { |
1489 char_u *line; | 1499 char_u *line; |
1490 ufunc_T *ufunc = (((dfunc_T *)def_functions.ga_data) | 1500 ufunc_T *ufunc = (((dfunc_T *)def_functions.ga_data) |
1496 | 1506 |
1497 if (ex_nesting_level > debug_break_level) | 1507 if (ex_nesting_level > debug_break_level) |
1498 { | 1508 { |
1499 linenr_T breakpoint; | 1509 linenr_T breakpoint; |
1500 | 1510 |
1501 if (!ufunc->uf_has_breakpoint) | 1511 if (!may_break_in_function(ufunc)) |
1502 return; | 1512 return; |
1503 | 1513 |
1504 // check for the next breakpoint if needed | 1514 // check for the next breakpoint if needed |
1505 breakpoint = dbg_find_breakpoint(FALSE, ufunc->uf_name, | 1515 breakpoint = dbg_find_breakpoint(FALSE, ufunc->uf_name, |
1506 iptr->isn_arg.debug.dbg_break_lnum); | 1516 iptr->isn_arg.debug.dbg_break_lnum); |