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.

> 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.

hundred-and-one symptoms of being an internet addict:
186. You overstay in the office so you can have more time surfing the net.

 /// Bram Moolenaar -- --   \\\
///        sponsor Vim, vote for features -- \\\
\\\  an exciting new programming language --        ///
 \\\            help me help AIDS victims --    ///

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

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 
For more options, visit

Raspunde prin e-mail lui