vim-jdb


Ⅰ. 插件描述

Ⅱ. 基本信息

创建日期:  2016-07-11
使用用户:  2
Github星:  9
插件作者:  Dica Developer

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'dica-developer/vim-jdb'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'dica-developer/vim-jdb'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'dica-developer/vim-jdb'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/dica-developer/vim-jdb

Ⅳ. 文档说明

# Attention the project is moved to https://gitlab.com/Dica-Developer/vim-jdb

vim-jdb

Its a JAVA debugger frontend plugin for VIM. It allows to debug a JAVA program via the JDB debugger. It allows remote debugging via attach parameter.
It marks by vim-jdb setted breakpoints and shows the current file and line the debugger stays in.

It requires VIM >= 8.0 and VIM compiled with channel, signs and job support.

How to use

  1. start JAVA process with the following debug agent option, e.g. `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005'
    `
  2. attach to the JAVA process from your VIM with VIM-JDB like :JDBAttach or by explicitly specifying host and port :JDBAttach localhost:5005
  3. now the JDB shell buffer should open and signal that it connected to the JAVA process
  4. open a JAVA file and go to the line in it where you want to set a breakpoint
  5. set a breakpoint on the current line in the current file by using the command :JDBBreakpointOnLine
  6. breakpoints are marked depending on your terminals and VIMs capabilities with a ⛔ or x
  7. if your programm stops at the breakpoint this is marked with a ->
  8. use the command :JDBStepOver to execute to the next line
  9. with :JDBCommand you can send any JDB command to the JDB JAVA process, e.g. you want to see all locals do :JDBCommands locals
  10. with :JDBContinue you can resume the execution until the next breakpoint is hits

Commands

CommandDescription
JDBAttachattach to a running JVM with a debug listener on localhost:5005, can be overwritten by given host:port as an argument
JDBDetachdetach the debugger UI from the application that is currently debugged
JDBBreakpointOnLineset a breakpoint on the current line
JDBClearBreakpointOnLineclear the breakpoint on the current line
JDBContinuecontinues the execution until the next breakpoint
JDBStepOversteps to the next line
JDBStepInsteps a level down the stack
JDBStepUpsteps a level up in the stack
JDBStepIsteps to the next instruction
JDBCommandsend any JDB command to the application under debug

Global variables

To specify the JDB command to use you can overwrite the following variable g:vimjdb_jdb_command. The default is jdb.

添加新评论