Mercurial > vim
comparison src/vim9execute.c @ 25004:70f55a30f03c v8.2.3039
patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Commit: https://github.com/vim/vim/commit/8cec9273d2518f2a9abcbd326722a2eba38d2a13
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jun 23 20:20:53 2021 +0200
patch 8.2.3039: Vim9: breakpoint at a comment line does not work
Problem: Vim9: breakpoint at a comment line does not work.
Solution: Add the comment line number to the debug instruction.
(closes #8429)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 23 Jun 2021 20:30:03 +0200 |
parents | 71b1e2ef0069 |
children | eac6e5a94e9d |
comparison
equal
deleted
inserted
replaced
25003:264025157c93 | 25004:70f55a30f03c |
---|---|
1471 if (!ufunc->uf_has_breakpoint) | 1471 if (!ufunc->uf_has_breakpoint) |
1472 return; | 1472 return; |
1473 | 1473 |
1474 // check for the next breakpoint if needed | 1474 // check for the next breakpoint if needed |
1475 breakpoint = dbg_find_breakpoint(FALSE, ufunc->uf_name, | 1475 breakpoint = dbg_find_breakpoint(FALSE, ufunc->uf_name, |
1476 iptr->isn_lnum - 1); | 1476 iptr->isn_arg.debug.dbg_break_lnum); |
1477 if (breakpoint <= 0 || breakpoint > iptr->isn_lnum) | 1477 if (breakpoint <= 0 || breakpoint > iptr->isn_lnum) |
1478 return; | 1478 return; |
1479 } | 1479 } |
1480 | 1480 |
1481 SOURCING_LNUM = iptr->isn_lnum; | 1481 SOURCING_LNUM = iptr->isn_lnum; |
1482 debug_context = ectx; | 1482 debug_context = ectx; |
1483 debug_var_count = iptr->isn_arg.number; | 1483 debug_var_count = iptr->isn_arg.debug.dbg_var_names_len; |
1484 | 1484 |
1485 for (ni = iptr + 1; ni->isn_type != ISN_FINISH; ++ni) | 1485 for (ni = iptr + 1; ni->isn_type != ISN_FINISH; ++ni) |
1486 if (ni->isn_type == ISN_DEBUG | 1486 if (ni->isn_type == ISN_DEBUG |
1487 || ni->isn_type == ISN_RETURN | 1487 || ni->isn_type == ISN_RETURN |
1488 || ni->isn_type == ISN_RETURN_VOID) | 1488 || ni->isn_type == ISN_RETURN_VOID) |
5474 case ISN_PROF_END: | 5474 case ISN_PROF_END: |
5475 smsg("%s%4d PROFILE END", pfx, current); | 5475 smsg("%s%4d PROFILE END", pfx, current); |
5476 break; | 5476 break; |
5477 | 5477 |
5478 case ISN_DEBUG: | 5478 case ISN_DEBUG: |
5479 smsg("%s%4d DEBUG line %d varcount %lld", pfx, current, | 5479 smsg("%s%4d DEBUG line %d-%d varcount %lld", pfx, current, |
5480 iptr->isn_lnum, iptr->isn_arg.number); | 5480 iptr->isn_arg.debug.dbg_break_lnum + 1, |
5481 iptr->isn_lnum, | |
5482 iptr->isn_arg.debug.dbg_var_names_len); | |
5481 break; | 5483 break; |
5482 | 5484 |
5483 case ISN_UNPACK: smsg("%s%4d UNPACK %d%s", pfx, current, | 5485 case ISN_UNPACK: smsg("%s%4d UNPACK %d%s", pfx, current, |
5484 iptr->isn_arg.unpack.unp_count, | 5486 iptr->isn_arg.unpack.unp_count, |
5485 iptr->isn_arg.unpack.unp_semicolon ? " semicolon" : ""); | 5487 iptr->isn_arg.unpack.unp_semicolon ? " semicolon" : ""); |