CCTree icon indicating copy to clipboard operation
CCTree copied to clipboard

ccglue.out format wrong

Open tracyone opened this issue 10 years ago • 0 comments

ccglue:ccglue-0.6.0 compile from source

Lubuntu 14.04 LTS 32bit

CCTREE vim config

let g:CCTreeKeyTraceForwardTree = '<C-\>>' "the symbol in current cursor's forward tree 
let g:CCTreeKeyTraceReverseTree = '<C-\><'
let g:CCTreeKeyHilightTree = '<C-\>l' " Static highlighting
let g:CCTreeKeySaveWindow = '<C-\>y'
let g:CCTreeKeyToggleWindow = '<C-\>w'
let g:CCTreeKeyCompressTree = 'zs' " Compress call-tree
let g:CCTreeKeyDepthPlus = '<C-\>='
let g:CCTreeKeyDepthMinus = '<C-\>-'
nnoremap <leader>u :call Do_CsTag()<cr>
nmap <leader>a :cs add cscope.out<cr>:CCTreeLoadXRefDBFromDisk ccglue.out<cr>

after added database ,press C-\ on current cursor function pop up: 2014_002 2014_003

I call following function to generate and add database

function! Do_CsTag()
    let dir = getcwd()
    if filereadable("tags")
        if(g:iswindows==1)
            let tagsdeleted=delete(dir."\\"."tags")
        else
            let tagsdeleted=delete("./"."tags")
        endif
        if(tagsdeleted!=0)
            echohl WarningMsg | echo "Fail to do tags! I cannot delete the tags" | echohl None
            return
        endif
    endif
    if filereadable("cscope.files")
        if(g:iswindows==1)
            let csfilesdeleted=delete(dir."\\"."cscope.files")
        else
            let csfilesdeleted=delete("./"."cscope.files")
        endif
        if(csfilesdeleted!=0)
            echohl WarningMsg | echo "Fail to do cscope! I cannot delete the cscope.files" | echohl None
            return
        endif
    endif
    if filereadable("cscope.out")
        if(g:iswindows==1)
            let csoutdeleted=delete(dir."\\"."cscope.out")
        else
            let csoutdeleted=delete("./"."cscope.out")
        endif
        if(csoutdeleted!=0)
            echohl WarningMsg | echo "I cannot delete the cscope.out,try again" | echohl None
            echo "kill the cscope connection"
            if has("cscope") && filereadable("cscope.out")
                silent! execute "cs kill cscope.out"
            endif
            if(g:iswindows==1)
                let csoutdeleted=delete(dir."\\"."cscope.out")
            else
                let csoutdeleted=delete("./"."cscope.out")
            endif
        endif
        if(csoutdeleted!=0)
            echohl WarningMsg | echo "I still cannot delete the cscope.out,failed to do cscope" | echohl None
            return
        endif
    endif
    if(executable('ctags'))
        silent! execute "!ctags -R --c-types=+p --fields=+S *"
        silent! execute "!ctags -R --c++-kinds=+p --fields=+iaS --extra=+q ."
    endif
    if(executable('cscope') && has("cscope") )
        if(g:iswindows!=1)
            silent! execute "!find $(pwd) -name \"*.[chsS]\" > ./cscope.files"
        else
            silent! execute "!dir /s/b *.c,*.cpp,*.h,*.java,*.cs,*.s,*.asm > cscope.files"
        endif
        silent! execute "!cscope -Rbkq -i cscope.files"
        execute "normal :"
        if filereadable("cscope.out")
            execute "cs add cscope.out"
            silent! execute "!ccglue -S cscope.out -o ccglue.out"
            execute "CCTreeLoadXRefDB ccglue.out"
        else
            echohl WarningMsg | echo "No cscope.out" | echohl None
        endif
    endif
endfunction

tracyone avatar Jul 09 '14 04:07 tracyone