From 59f55a62bec36f7d8b546715a116b996e39e9d89 Mon Sep 17 00:00:00 2001 From: IdanArye Date: Sat, 8 Feb 2014 22:58:34 +0200 Subject: [PATCH] Displaying exceptions in JDB --- autoload/vebugger/gdb.vim | 1 + autoload/vebugger/jdb.vim | 11 +++++++++++ autoload/vebugger/std.vim | 12 ++++++++++-- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/autoload/vebugger/gdb.vim b/autoload/vebugger/gdb.vim index 60a5a48..b563b5b 100644 --- a/autoload/vebugger/gdb.vim +++ b/autoload/vebugger/gdb.vim @@ -5,6 +5,7 @@ function! vebugger#gdb#start(binaryFile,args) \: 'gdb '.fnameescape(a:binaryFile))) let l:debugger.state.gdb={} + call l:debugger.writeLine("set width 0") call l:debugger.writeLine("define hook-stop\nwhere\nend") call l:debugger.writeLine("start") diff --git a/autoload/vebugger/jdb.vim b/autoload/vebugger/jdb.vim index 6d1a72a..ad329fa 100644 --- a/autoload/vebugger/jdb.vim +++ b/autoload/vebugger/jdb.vim @@ -19,6 +19,7 @@ function! vebugger#jdb#start(entryClass,args) call l:debugger.writeLine('monitor where') call l:debugger.addReadHandler(function('s:readWhere')) + call l:debugger.addReadHandler(function('s:readException')) call l:debugger.addReadHandler(function('s:readEvaluatedExpressions')) call l:debugger.setWriteHandler('std','flow',function('s:writeFlow')) @@ -65,6 +66,16 @@ function! s:readWhere(pipeName,line,readResult,debugger) endif endfunction +function! s:readException(pipeName,line,readResult,debugger) + if 'out'==a:pipeName + let l:matches=matchlist(a:line,'\vException occurred:\s+(\S+)') + if 1