projects
/
pygdb.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add LICENSE
[pygdb.git]
/
pygdb.vim
diff --git
a/pygdb.vim
b/pygdb.vim
index ea552d307a0b130646770c4b4607a0de7527de64..79a557e074dafc0824832121de074825bd03e619 100644
(file)
--- a/
pygdb.vim
+++ b/
pygdb.vim
@@
-1,4
+1,11
@@
-"shuber, 2008-06-08
+"pygdb.vim - pygtk interface to gdb in connection with (g)vim
+" Maintainer: Stefan Huber <shuber@cosy.sbg.ac.at>
+
+
+if !has('python')
+ echo "Error: Required vim compiled with +python"
+ finish
+endif
if ! exists("g:pygdb")
if ! exists("g:pygdb")
@@
-28,22
+35,25
@@
clientcmd = ""
execsign = None
def gdbLaunch():
execsign = None
def gdbLaunch():
- global gdb
term, mainctrlwnd, statuswnd, gdbBps, clientcmd, gdbthread
+ global gdb
Bps, clientcmd, pygdbdir
- clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd).strip()
+ clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd)
+
+ #Pressed esq?
+ if clientcmd == None:
+ clientcmd = ""
+ return
+
+ #Strip away white space
+ clientcmd = clientcmd.strip()
if clientcmd.strip()=="":
print "No command given!"
return
if clientcmd.strip()=="":
print "No command given!"
return
- #Add the breakpoints to the configuration
- conf = Configuration.Configuration()
- conf.load(".pygdb.conf")
- for bp in gdbBps:
- conf.addBreak(bp["file"], bp["lineno"], bp["cond"])
- conf.store(".pygdb.conf")
+ gdbWriteConfig()
- vim.command("!python %s/pygdb.py
%s &\n" % (pygdbdir
, clientcmd))
+ vim.command("!python %s/pygdb.py
--vim-servername %s %s &\n" % (pygdbdir, vim.eval("v:servername")
, clientcmd))
def gdbToggleBreakpoint(lineno=None, file=None):
def gdbToggleBreakpoint(lineno=None, file=None):
@@
-197,7
+207,12
@@
def toAbsPath(path):
#We need the client command to expand the paths...
while clientcmd == "" or not cmdset:
#We need the client command to expand the paths...
while clientcmd == "" or not cmdset:
- clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd).strip()
+ clientcmd = vim.eval("input('Client commando: ', '%s')" % clientcmd)
+
+ if clientcmd == None:
+ clientcmd = ""
+ clientcmd = clientcmd.strip()
+
cmdset = True
#Get the dirs where executeable is in
cmdset = True
#Get the dirs where executeable is in
@@
-214,8
+229,6
@@
def gdbLoadConfig():
global clientcmd, gdbBps, cmdset
global clientcmd, gdbBps, cmdset
-
-
#Load configuration
conf = Configuration.Configuration()
conf.load(".pygdb.conf")
#Load configuration
conf = Configuration.Configuration()
conf.load(".pygdb.conf")
@@
-228,6
+241,10
@@
def gdbLoadConfig():
for bp in conf.breakpoints:
bp["file"] = toAbsPath( bp["file"] )
addBreakpoint(bp["file"], bp["lineno"], bp["cond"])
for bp in conf.breakpoints:
bp["file"] = toAbsPath( bp["file"] )
addBreakpoint(bp["file"], bp["lineno"], bp["cond"])
+
+ #Set the command from config
+ if conf.getCommand() != None:
+ clientcmd = conf.getCommand()
#Set current execution line
if conf.isCurrposSet():
#Set current execution line
if conf.isCurrposSet():
@@
-235,6
+252,19
@@
def gdbLoadConfig():
setExecutionLine(file, conf.currlineno)
else:
delExecutionLine()
setExecutionLine(file, conf.currlineno)
else:
delExecutionLine()
+
+
+def gdbWriteConfig():
+
+ #Add the breakpoints to the configuration
+ conf = Configuration.Configuration()
+ conf.load(".pygdb.conf")
+ conf.breakpoints = []
+ for bp in gdbBps:
+ conf.addBreak(bp["file"], bp["lineno"], bp["cond"])
+ conf.store(".pygdb.conf")
+
+
>>
highlight ExecutionLine term=bold ctermbg=DarkGreen ctermfg=Black guibg=LightGreen guifg=Black
>>
highlight ExecutionLine term=bold ctermbg=DarkGreen ctermfg=Black guibg=LightGreen guifg=Black