现在的缺陷是无法debug inner class,等什么时候蛋疼了再写个正则匹配下内部类。不过现在这种程度应该能解决很多问题了。
下面上渣代码,请尽情喷。
vim script:
function! DebugContacts()
let ori_str = expand("%:r")
let start_index = matchend(ori_str, "src\.")
let debug_path = strpart(ori_str, start_index, strlen(ori_str))
let debug_path = substitute(debug_path, "/", ".", "g")
let debug_path .= ":".line(".")
echo expand(debug_path)
exec "!echo stop at ".debug_path
exec "!{ echo "." stop at \"".debug_path."\"; cat; } | debug_contacts"
endf
noremap <leader>dd :call DebugContacts()<cr>
debug_contacts是写在shell脚本里面的
function debug_contacts()
{
local pid=$(adb shell ps | grep android.process.acore | awk '{print $1}')
adb forward tcp:7777 jdwp:$pid
jdb -attach 7777 -sourcepath $CONTACTS/src
}