new feature: selecting on breakpoint sets entry-ctrl-text
[pygdb.git] / pygdb.vim
index 1926f3e60b5406859a794c3719884c46dbc109db..b67dd791dbc75626a6e8ee2761253479f63ee66f 100644 (file)
--- a/pygdb.vim
+++ b/pygdb.vim
@@ -39,17 +39,22 @@ gdbthread = None
 def gdbLaunch():
        global gdbterm, mainctrlwnd, statuswnd, gdbBps, clientcmd, gdbthread
 
-       if gdbterm == None:
 
-               clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd)
+       clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd).strip()
 
-               gdbterm, mainctrlwnd, statuswnd = pygdb.launchDebugger(clientcmd, False)
 
-               for bp in gdbBps:
-                       statuswnd.breakpointsFrame.addBreakpoint(bp["file"], bp["lineno"], bp["cond"])
+       if clientcmd.strip()=="":
+               print "No command given!"
+               return
 
-               gtk.main()
-               gdbterm = None  
+       gdbterm, mainctrlwnd, statuswnd = pygdb.launchDebugger(clientcmd, False)
+
+       for bp in gdbBps:
+               statuswnd.breakpointsFrame.addBreakpoint(bp["file"], bp["lineno"], bp["cond"])
+
+       print "Started dbg session."
+       gtk.main()
+       print "Finished dbg session."
 
 
 def gdbToggleBreakpoint(lineno=None, file=None):