[vim/vim] Termdebug in Vim9 not showing breakpoints/showing current debug line (Issue #11958)

26 views
Skip to first unread message

tonycapp

unread,
Feb 7, 2023, 1:03:59 PM2/7/23
to vim/vim, Subscribed

When using termdebug in Vim9 it doesn't show a number in the signcolumn when setting a breakpoint. It also doesn't highlight the current line when stepping through the debugger. I tested on VIM 8.2 and the expected behavior works as I expected. So I'm not sure what's going on. I'm using up to date GCC and GDB on Windows 10, and latest stable gVim. I'm also using a default vimrc with no extra plugins.

version:

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Jan 14 2023 23:28:54)
MS-Windows 64-bit GUI version with OLE support
Included patches: 1-1199
Compiled by appveyor@APPVYR-WIN
Huge version with GUI.  Features included (+) or not (-):
+acl                +cindent            +cursorshape        -farsi              +job                +menu               +packages           +reltime            -sun_workshop       -tgetent            +visualextra
+arabic             +clientserver       +dialog_con_gui     +file_in_path       +jumplist           +mksession          +path_extra         +rightleft          +syntax             +timers             +vreplace
+autocmd            +clipboard          +diff               +find_in_path       +keymap             +modify_fname       +perl/dyn           +ruby/dyn           +tag_binary         +title              -vtp
+autochdir          +cmdline_compl      +digraphs           +float              +lambda             +mouse              +persistent_undo    +scrollbind         -tag_old_static     +toolbar            +wildignore
+autoservername     +cmdline_hist       +directx            +folding            +langmap            +mouseshape         +popupwin           +signs              -tag_any_white      +user_commands      +wildmenu
+balloon_eval       +cmdline_info       -dnd                -footer             +libcall            +multi_byte_ime/dyn -postscript         +smartindent        -tcl                +vartabs            +windows
-balloon_eval_term  +comments           -ebcdic             +gettext/dyn        +linebreak          +multi_lang         +printer            +sodium/dyn         -termguicolors      +vertsplit          +writebackup
+browse             +conceal            +emacs_tags         -hangul_input       +lispindent         +mzscheme/dyn       +profile            +sound              +terminal           +vim9script         -xfontset
++builtin_terms     +cryptv             +eval               +iconv/dyn          +listcmds           +netbeans_intg      +python/dyn         +spell              -termresponse       +viminfo            -xim
+byte_offset        +cscope             +ex_extra           +insert_expand      +localmap           +num64              +python3/dyn        +startuptime        +textobjects        +virtualedit        +xpm_w32
+channel            +cursorbind         +extra_search       +ipv6               +lua/dyn            +ole                +quickfix           +statusline         +textprop           +visual             -xterm_save
   system vimrc file: "$VIM\vimrc"
     user vimrc file: "$HOME\_vimrc"
 2nd user vimrc file: "$HOME\vimfiles\vimrc"
 3rd user vimrc file: "$VIM\_vimrc"
      user exrc file: "$HOME\_exrc"
  2nd user exrc file: "$VIM\_exrc"
  system gvimrc file: "$VIM\gvimrc"
    user gvimrc file: "$HOME\_gvimrc"
2nd user gvimrc file: "$HOME\vimfiles\gvimrc"
3rd user gvimrc file: "$VIM\_gvimrc"
       defaults file: "$VIMRUNTIME\defaults.vim"
    system menu file: "$VIMRUNTIME\menu.vim"
Compilation: cl -c /W3 /GF /nologo -I. -Iproto -DHAVE_PATHDEF -DWIN32 -DHAVE_STDINT_H  -DFEAT_CSCOPE -DFEAT_TERMINAL -DFEAT_SOUND -DFEAT_NETBEANS_INTG -DFEAT_JOB_CHANNEL -DFEAT_IPV6 -DHAVE_INET_NTOP   -DFEAT_XPM_W32 -DHAVE_SODIUM -DDYNAM
IC_SODIUM -DDYNAMIC_SODIUM_DLL=\"libsodium.dll\" /I "C:\libsodium\include" -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 /source-charset:utf-8 /MP /Ox /GL -DNDEBUG /Zl /MT /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE -DFEAT_OLE -DFEAT_
MBYTE_IME -DDYNAMIC_IME -DFEAT_GUI_MSWIN -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DDYNAMIC_ICONV -DDYNAMIC_GETTEXT -DFEAT_LUA -DDYNAMIC_LUA -DDYNAMIC_LUA_DLL=\"lua54.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTH
ON_DLL=\"python27.dll\" -DFEAT_PYTHON3 -DDYNAMIC_PYTHON3 -DDYNAMIC_PYTHON3_DLL=\"python311.dll\" -DFEAT_MZSCHEME -I "C:\racket\include" -DMZ_PRECISE_GC -DDYNAMIC_MZSCHEME -DDYNAMIC_MZSCH_DLL=\"libracket3m_da32rk.dll\" -DDYNAMIC_MZGC_DLL=
\"libracket3m_da32rk.dll\" -DFEAT_PERL -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl532.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"x64-msvcrt-ruby300.dll\" -DRUBY_VERSION=30 -DFEAT_HUGE /
Fd.\ObjGXOULYHRZAMD64/ /Zi
Linking: link /nologo /opt:ref /LTCG /HIGHENTROPYVA:NO oldnames.lib kernel32.lib advapi32.lib shell32.lib gdi32.lib  comdlg32.lib ole32.lib netapi32.lib uuid.lib user32.lib  /machine:AMD64 version.lib  winspool.lib comctl32.lib libcmt.li
b oleaut32.lib  /nodefaultlib:lua54.lib  /STACK:8388608  /nodefaultlib:python27.lib /nodefaultlib:python311.lib    winmm.lib WSock32.lib Ws2_32.lib xpm\x64\lib-vc14\libXpm.lib  /PDB:gvim.pdb -debug


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11958@github.com>

Bram Moolenaar

unread,
Feb 17, 2023, 5:01:31 PM2/17/23
to vim/vim, Subscribed


> When using termdebug in Vim9 it doesn't show a number in the
> signcolumn when setting a breakpoint. It also doesn't highlight the
> current line when stepping through the debugger. I tested on VIM 8.2
> and the expected behavior works as I expected. So I'm not sure what's
> going on. I'm using up to date GCC and GDB on Windows 10, and latest
> stable gVim. I'm also using a default vimrc with no extra plugins.

I do not recognize this problem. Perhaps it is specific for MS-Windows?


--
hundred-and-one symptoms of being an internet addict:
134. You consider bandwidth to be more important than carats.

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11958/1435323661@github.com>

Lauri Fiestas

unread,
Dec 20, 2023, 10:50:29 AM12/20/23
to vim/vim, Subscribed

I had the same issue also on Windows 10 Vim9 both gVim and terminal. I was able to fix the issue by adding an empty comment to DecodeMessage() in termdebug.vim located in "C:\Program Files (x86)\Vim\vim90\pack\dist\opt\termdebug\plugin" on my machine like this:

  return a:quotedText
        \ ->substitute('^"\|".*\|\\n', '', 'g')
        "
        \ ->substitute('\\t', "\t", 'g')

I have no idea what's going on but works and now I'm too afraid to touch the file further 😂. Output to command window is still messed up but this is enough for me and still beats using GDB from terminal.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11958/1864719453@github.com>

Christian Brabandt

unread,
Dec 20, 2023, 11:07:30 AM12/20/23
to vim/vim, Subscribed

can you please show the complete DecodeMessage() function then? Also, just for completeness, where does your gdb come from on windows?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11958/1864748344@github.com>

Lauri Fiestas

unread,
Dec 20, 2023, 11:29:38 AM12/20/23
to vim/vim, Subscribed

Sure, here's the complete DecodeMessage() function:

func s:DecodeMessage(quotedText)
  if a:quotedText[0] != '"'
    echoerr 'DecodeMessage(): missing quote in ' . a:quotedText
    return
  endif
  
  return a:quotedText
        \ ->substitute('^"\|".*\|\\n', '', 'g')
        "
        \ ->substitute('\\t', "\t", 'g')
        " multi-byte characters arrive in octal form
        " NULL-values must be kept encoded as those break the string otherwise
        \ ->substitute('\\000', s:NullRepl, 'g')
        \ ->substitute('\\\o\o\o', {-> eval('"' .. submatch(0) .. '"')}, 'g')
        " Note: GDB docs also mention hex encodings - the translations below work
        "       but we keep them out for performance-reasons until we actually see
        "       those in mi-returns
        " \ ->substitute('\\0x\(\x\x\)', {-> eval('"\x' .. submatch(1) .. '"')}, 'g')
        " \ ->substitute('\\0x00', s:NullRepl, 'g')
        \ ->substitute('\\\\', '\', 'g')
        \ ->substitute(s:NullRepl, '\\000', 'g')
endfunc

My GDB is installed as a MSYS2 package but Vim was installed by Windows installer and not as MSYS2 package. Path to Vim is exported in my MSYS2 .bashrc and I'm launching Vim and gVim from MSYS2 terminal so it can find GDB from PATH.

Here's some output from logfile that shows GDB MI output when setting a brakepoint:

  8.969716 : received from gdb: =breakpoint-created,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x000000014000149d",func="main",file="test.c",fullname="C:\\Users\\OMISTAJA\\msys2\\home\\OMISTAJA\\kokeiluu\\c_kokeiluu\\test.c",line="8",thread-groups=["i1"],times="0",original-location="main"}


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11958/1864781119@github.com>

Christian Brabandt

unread,
Dec 20, 2023, 12:17:27 PM12/20/23
to vim/vim, Subscribed

Hm, I don't understand why it works for you now. Adding a single " should not do any harm but also not fix anything. However I can already see a problem (which I fixed in c9a4a8a (patch v9.0.1663), that is:

fullname="C:\Users\OMISTAJA\msys2\home\OMISTAJA\kokeiluu\c_kokeiluu\test.c

which will replace the \t in \\test.c to a literal tab.

So it seems your Vim version is slightly out of date, can you please update and report if the update fixes your problem?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11958/1864850068@github.com>

Lauri Fiestas

unread,
Dec 20, 2023, 12:35:44 PM12/20/23
to vim/vim, Subscribed

Updated to v9.0.2181. Fixed everything! Breakpoints show in gutter, current line gets highlighted, GDB output in command window is not messed up anymore, and unrelated to this issue, scrolling works now too!


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issues/11958/1864873806@github.com>

Yegappan Lakshmanan

unread,
May 5, 2024, 2:03:03 AM (5 days ago) May 5
to vim/vim, Subscribed

Closed #11958 as completed.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/issue/11958/issue_event/12706376692@github.com>

Reply all
Reply to author
Forward
0 new messages