Mercurial > vim
comparison runtime/pack/dist/opt/termdebug/plugin/termdebug.vim @ 26100:babd9f1dbe12
Update runtime files
Commit: https://github.com/vim/vim/commit/113cb513f76d8866cbb6dc85fa18aded753e01da
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Nov 7 20:27:04 2021 +0000
Update runtime files
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 07 Nov 2021 21:30:10 +0100 |
parents | d4faa2c5211b |
children | 624439a39432 |
comparison
equal
deleted
inserted
replaced
26099:7dbc843d95ff | 26100:babd9f1dbe12 |
---|---|
1 " Debugger plugin using gdb. | 1 " Debugger plugin using gdb. |
2 " | 2 " |
3 " Author: Bram Moolenaar | 3 " Author: Bram Moolenaar |
4 " Copyright: Vim license applies, see ":help license" | 4 " Copyright: Vim license applies, see ":help license" |
5 " Last Change: 2021 Aug 23 | 5 " Last Change: 2021 Oct 26 |
6 " | 6 " |
7 " WORK IN PROGRESS - Only the basics work | 7 " WORK IN PROGRESS - Only the basics work |
8 " Note: On MS-Windows you need a recent version of gdb. The one included with | 8 " Note: On MS-Windows you need a recent version of gdb. The one included with |
9 " MingW is too old (7.6.1). | 9 " MingW is too old (7.6.1). |
10 " I used version 7.12 from http://www.equation.com/servlet/equation.cmd?fa=gdb | 10 " I used version 7.12 from http://www.equation.com/servlet/equation.cmd?fa=gdb |
532 " Drop the gdb prompt, we have our own. | 532 " Drop the gdb prompt, we have our own. |
533 " Drop status and echo'd commands. | 533 " Drop status and echo'd commands. |
534 if a:text == '(gdb) ' || a:text == '^done' || a:text[0] == '&' | 534 if a:text == '(gdb) ' || a:text == '^done' || a:text[0] == '&' |
535 return | 535 return |
536 endif | 536 endif |
537 if a:text =~ '^^error,msg=' | 537 if a:text =~ '^\^error,msg=' |
538 let text = s:DecodeMessage(a:text[11:]) | 538 let text = s:DecodeMessage(a:text[11:]) |
539 if exists('s:evalexpr') && text =~ 'A syntax error in expression, near\|No symbol .* in current context' | 539 if exists('s:evalexpr') && text =~ 'A syntax error in expression, near\|No symbol .* in current context' |
540 " Silently drop evaluation errors. | 540 " Silently drop evaluation errors. |
541 unlet s:evalexpr | 541 unlet s:evalexpr |
542 return | 542 return |
734 let s:parsing_disasm_msg = 2 | 734 let s:parsing_disasm_msg = 2 |
735 endif | 735 endif |
736 else | 736 else |
737 let value = substitute(a:msg, '^\~\"[ ]*', '', '') | 737 let value = substitute(a:msg, '^\~\"[ ]*', '', '') |
738 let value = substitute(value, '^=>[ ]*', '', '') | 738 let value = substitute(value, '^=>[ ]*', '', '') |
739 let value = substitute(value, '\\n\" | 739 let value = substitute(value, '\\n\"\r$', '', '') |
740 $', '', '') | |
741 let value = substitute(value, '\\n\"$', '', '') | 740 let value = substitute(value, '\\n\"$', '', '') |
742 let value = substitute(value, ' | 741 let value = substitute(value, '\r', '', '') |
743 ', '', '') | |
744 let value = substitute(value, '\\t', ' ', 'g') | 742 let value = substitute(value, '\\t', ' ', 'g') |
745 | 743 |
746 if value != '' || !empty(s:asm_lines) | 744 if value != '' || !empty(s:asm_lines) |
747 call add(s:asm_lines, value) | 745 call add(s:asm_lines, value) |
748 endif | 746 endif |
982 endif | 980 endif |
983 call s:SendCommand('-exec-run') | 981 call s:SendCommand('-exec-run') |
984 endfunc | 982 endfunc |
985 | 983 |
986 func s:SendEval(expr) | 984 func s:SendEval(expr) |
987 call s:SendCommand('-data-evaluate-expression "' . a:expr . '"') | 985 " clean up expression that may got in because of range |
988 let s:evalexpr = a:expr | 986 " (newlines and surrounding spaces) |
987 let expr = a:expr | |
988 if &filetype ==# 'cobol' | |
989 " extra cleanup for COBOL: _every: expression ends with a period, | |
990 " a trailing comma is ignored as it commonly separates multiple expr. | |
991 let expr = substitute(expr, '\..*', '', '') | |
992 let expr = substitute(expr, '[;\n]', ' ', 'g') | |
993 let expr = substitute(expr, ',*$', '', '') | |
994 else | |
995 let expr = substitute(expr, '\n', ' ', 'g') | |
996 endif | |
997 let expr = substitute(expr, '^ *\(.*\) *', '\1', '') | |
998 | |
999 call s:SendCommand('-data-evaluate-expression "' . expr . '"') | |
1000 let s:evalexpr = expr | |
989 endfunc | 1001 endfunc |
990 | 1002 |
991 " :Evaluate - evaluate what is under the cursor | 1003 " :Evaluate - evaluate what is under the cursor |
992 func s:Evaluate(range, arg) | 1004 func s:Evaluate(range, arg) |
993 if a:arg != '' | 1005 if a:arg != '' |
1058 " Result of s:SendEval() failed, ignore. | 1070 " Result of s:SendEval() failed, ignore. |
1059 let s:ignoreEvalError = 0 | 1071 let s:ignoreEvalError = 0 |
1060 let s:evalFromBalloonExpr = 0 | 1072 let s:evalFromBalloonExpr = 0 |
1061 return | 1073 return |
1062 endif | 1074 endif |
1063 echoerr substitute(a:msg, '.*msg="\(.*\)"', '\1', '') | 1075 let msgVal = substitute(a:msg, '.*msg="\(.*\)"', '\1', '') |
1076 echoerr substitute(msgVal, '\\"', '"', 'g') | |
1064 endfunc | 1077 endfunc |
1065 | 1078 |
1066 func s:GotoSourcewinOrCreateIt() | 1079 func s:GotoSourcewinOrCreateIt() |
1067 if !win_gotoid(s:sourcewin) | 1080 if !win_gotoid(s:sourcewin) |
1068 new | 1081 new |