Christian wrote: > > > Still when the current session is finished and a new session is run > > > using `:Termdebug vim` it errors out with E174, because the commands are > > > already defined. > > > > I don't see that. There was an error for one command, it was missing in > > the list of the cleanup function. > > Strange I had it yesterday all day long but now cannot reproduce it. > > > > How about to delete the commands when the first window > > > (the one in which you enter the gdb commands) is closed? > > > Alternatively, please use the `!` argument to the `:command` definition. > > > > I avoid using !, because it would cover up overwriting an existing > > command (that might do something completely different). It's a bit of > > a risk already, using simple names such as "Finish" and "Step". > > > > > My use case is usually I want to run with a clean state. How about using > > > the special separator '--' to separate gdb arguments from process > > > specific arguments. This way I can actually run > > > `:Termdebug vim -- --clean -c ":call setline('..')"` and start debugging > > > from a good initial state. > > > > > > The attached patch does those two things. > > > > Hmm, it's different from how gdb is normally used. And it's also not > > how you would start Vim. Thus introducing a whole new syntax. > > > > When using a core file or running process the command arguments would > > not be used. Thus we would need some way to specify "this is the > > command I want to run". > > > > Perhaps we can use two commands, one to start with gdb arguments, one > > with the command to run. > > :Termdebug vim core > > :TermdebugCommand vim --clean > > > > Something like that? We could also use a command to make gdb execute > > "run" right away. Sometimes it's a hassle that one needs to navigate to > > the gdb window to type "run" and then navigate to the program window to > > type something: > > :TermdebugRun vim --clean test.txt > > This would start the debugger on Vim and do "run --clean test.txt" in > > the gdb window and put the cursor in the command window. > > Here is a patch. I did not add the TermdebugRun command, but rather use > the optional '!' to indicate to run the command.
Thanks. I had to fix a few problems, but I like the idea of using ! to execute. -- hundred-and-one symptoms of being an internet addict: 196. Your computer costs more than your car. /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org /// -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.