ctag와 cscope 사용 질문입니다.

jamongx의 이미지

아래 동일한 내용의 글들을 많이 찾아봤는데요

참 어렵네요 ㅡㅡ; 이거 오늘도 하루 공치고 삽질하고 부디 불쌍히 여기시어...

일단 운영체제는 솔라리스 입니다.
cscope는 패키지로 설치했구요 ctags는 소스를 다운받아서 컴파일해서 설치했습니다. 여기까지는 어렵지 않았거든요

vim(6.0버전)도 패키지가 있길래 glib ncurses gtk 먼저 깔고 설치했습니다.

이제 이걸 사용해 볼라고 하는데요
ctags의 경우 리눅스에서는 -R 스위치가 적용이 되는거 같은데 솔라리스에서는 먹히지 안네요?

그래서 find . -type f -name "*.[ ch] "-exec ctags -a "{}"\ ; 이런 명령어를 사용하라는데요 "*.[ ch] " 이거이 이해가 안되는데요 소스가 cpp면 [cpph] 이렇게 해야 하나요? 아무튼 태크파일을 못만들고 있습니다. ㅡㅡ;

두번째는 cscope를 사용하려고 하는데요 이건 용하게 cscope -b -R 하면 아위 디렉토리 까지 읽어서 tag 파일을 만듭니다. 에러 없이요

그런데 이걸 vim과 연결시키는게 문제가 되는데요 vi랑 별다른거 없이 색깔 구분도 안되고요 cscope랑 연계를 시키려면 cscope_maps.vim 파일을 다운받아서(홈페이지에서) $HOME/.vim/plugin/에 카피를 하라는데요 그런 디렉토리도 없고 프로파일도 먼지 모르겠고 vim -t cscope.out 이렇게 실행시키면 태그가 없다는 메시지가 나오거든요 ㅡㅡ

제발 뭐가 문제인가요 답변 부탁드립니다.

아 머리아퍼 머리좀 식히고 와야지 ㅡㅡ;

notexist의 이미지

잘은 모르지만...
원래 ctags는 -R이 안 먹는거같던데요...
-R지원되는 것은 exctags일겁니다.
보통 리눅스에서는 exctags가 ctags로 깔려있는것같았구요...
vi대신 vim이 깔려있듯이...

There is more than one way to do it...

hermian의 이미지

jamongx wrote:

일단 운영체제는 솔라리스 입니다.
cscope는 패키지로 설치했구요 ctags는 소스를 다운받아서 컴파일해서 설치했습니다. 여기까지는 어렵지 않았거든요

http://ctags.sourceforge.net/ 이 곳의 ctags를 받아서 compile하시면 -R 옵션을 먹을 겁니다.
아니면 http://people.kldp.org/~namsh/doc/vim/vim-feature.html#TAGS 를 이용하시면 됩니다. (멀티 디렉토리 tag기능이죠)
jamongx wrote:

vim(6.0버전)도 패키지가 있길래 glib ncurses gtk 먼저 깔고 설치했습니다.

흠 vim도 cscope를 지원하도록 컴파일 되어 있어야 합니다.
지금 회사가 아니라 잘 모르겠지만 커맨드라인에서 컴파일 옵션을 아마 확인할 수 있을 겁니다.
회사의 vim이 cscope를 지원하지 않아서 사용해보지 못해 모르겠군요.
jamongx wrote:

그래서 find . -type f -name "*.[ ch] "-exec ctags -a "{}"\ ; 이런 명령어를 사용하라는데요 "*.[ ch] " 이거이 이해가 안되는데요 소스가 cpp면 [cpph] 이렇게 해야 하나요? 아무튼 태크파일을 못만들고 있습니다. ㅡㅡ;

find . -o -name "*.cpp" -o -name "*.h" -print | xargs ctags -a를 사용하면 안될까요? 지금 그냥 집이고 윈도우라 :) 해보진 못했습니다.
jamongx wrote:

그런데 이걸 vim과 연결시키는게 문제가 되는데요 vi랑 별다른거 없이 색깔 구분도 안되고요

그냥 cscope에서 소스를 볼때 vim으로 보려면 쉘의 EDIOTR를 vim으로 설정해 주어야 합니다.
jamongx wrote:

cscope랑 연계를 시키려면 cscope_maps.vim 파일을 다운받아서(홈페이지에서) $HOME/.vim/plugin/에 카피를 하라는데요 그런 디렉토리도 없고 프로파일도 먼지 모르겠고 vim -t cscope.out 이렇게 실행시키면 태그가 없다는 메시지가 나오거든요 ㅡㅡ

.vim을 만들고 넣어주면 안될까요 -.-;; 이것도 안해봐서요. ㅎㅎ
결국 제 답변은 다 조금씩의 힌트 밖에 안되는 군요.
열심히 해보시고 wiki에 멋진 문서를 등록하시기 바랍니다.
저희 회사의 solaris의 vim은 gvim으로 하면 한글이 모두 깨어지고, 한텀과는 칼라도 잘 안맞아 겨우 색깔만 조금 맞춰서 사용하고 cscope는 별도로 사용합니다. 쩝...
jamongx의 이미지

감사합니다.

함 해보께요

용모수려 재색겸비

jamongx의 이미지

http://ctags.sourceforge.net/에서 소스 받아서 컴파일 해봤는데요 -R 안먹네요 ^^;

용모수려 재색겸비

gbkwon의 이미지

jamongx wrote:
http://ctags.sourceforge.net/에서 소스 받아서 컴파일 해봤는데요 -R 안먹네요 ^^;

안된다니 이상하군요.. 분명히 옵션에 있습니다. 저도 잘 사용하고 있구요...

바이너리를 직접 설치 하여 사용해 보세요.. 컴파일 옵션이 잘못 되었을 수도 잇습니다..

1 Exuberant Ctags 5.2.2, Copyright (C) 1996-2001 Darren Hiebert
2 Compiled: Feb 26 2002, 04:51:30
3 Addresses: <dhiebert@users.sourceforge.net>, http://ctags.sourceforge.net
4 Optional compiled features: +wildcards, +regex
5
6 Usage: ctags [options] [file(s)]
7
8 -a Append the tags to an existing tag file.
9 -B Use backward searching patterns (?...?).
10 -e Output tag file for use with Emacs.
11 -f <name>
12 Write tags to specified file. Value of "-" writes tags to stdout
13 ["tags"; or "TAGS" when -e supplied].
14 -F Use forward searching patterns (/.../) (default).
15 -h <list>
16 Specify list of file extensions to be treated as include files.
17 [".h.H.hh.hpp.hxx.h++"].
18 -I <list|@file>
19 A list of tokens to be specially handled is read from either the
20 command line or the specified file.
21 -L <file>
22 A list of source file names are read from the specified file.
23 If specified as "-", then standard input is read.
24 -n Equivalent to --excmd=number.
25 -N Equivalent to --excmd=pattern.
26 -o Alternative for -f.
27 -R Equivalent to --recurse.
28 -u Equivalent to --sort=no.
29 -V Equivalent to --verbose.

jamongx의 이미지

./configure
make all
make install 이런 순서로 인스톨 했는데

결국 링크 문제 있것 같네요

/usr/bin 에도 있고
/usr/local/bin에도 있고 두개가 보이네요 ㅡㅡ;

용모수려 재색겸비

eminency의 이미지

솔라리스엔 원래 ctags가 있습니다. 써보진 않았지만 man 페이지를 보니 -R이 없는 버전이군요.
패쓰 문제로 인해 /usr/bin의 ctags가 먼저 실행되는 것 같은데 과감히 지우시든지 이름을 바꿔놓아야 제대로 쓰실 수 있을 듯...ㅡㅡ;;

노루가 사냥꾼의 손에서 벗어나는 것 같이, 새가 그물치는 자의 손에서 벗어나는 것 같이 스스로 구원하라 -잠언 6:5

jamongx의 이미지

예전에 설치되어있는

/usr/bin의 ctags를 과감히 삭제했더니

/usr/local/bin에 설치된 ctags를 사용할수 있네요

ㅎㅎㅎ

참고로 -R 스위치가 적용되는 ctags는

Exuberant Ctags입니다.

ctags.sourceforge.net <- 여기서 다운 받을수 있져

계속 연구해서 글 올리겠심다. ^^;

용모수려 재색겸비

jcly2의 이미지

ctags를 반드시 사용해야하나여.. cscope를 사용하는데.. ?

예전에 사용할 때 directory에서 find . -name "*.[ch]" -print > list.my 해서 리스트 파일을 만든 다음에 cscope -i list.my 이런 식으로 쉽게 사용했던 것같은데.. ^^ 하위 디렉토리도 모두 검색해서 처리할 수 있었던 것같은데여..

hermian의 이미지

vim --version해보시면 컴파일 옵션이 있습니다. +, -로 있는데 -는 빠진겁니다. 저히 회사 solaris에 설치된 vim입니다. 멀티랑귀지도 꺼져 있고, cscope도 꺼져 있습니다. -.-'' 관리자한테 뭐라고 하기 귀찮아서 그냥 씁니다. (실은 이맥스를 더 많이 써서요.)
http://cscope.sourceforge.net/large_projects.html 에 보시면 Linux커널 분석하는 팁이 있는데 이런씩으로 쓰시면 뭐...
그래도 역시 vim은 멀티디렉토리 tag지원이 너무나 짱입니다. :)
스크립트하나짜서 돌리면 죽이죠 ㅎㅎ
$ vim --version
VIM - Vi IMproved 6.0 (2001 Sep 26, compiled Mar 13 2002 15:49:54)
Compiled by mnetha@solomon
Normal version without GUI. Features included (+) or not (-):
+autocmd -balloon_eval -browse +builtin_terms +byte_offset +cindent
-clientserver -clipboard +cmdline_compl +cmdline_hist +cmdline_info +comments
+cryptv -cscope +dialog_con +diff +digraphs -ebcdic -emacs_tags +eval +ex_extra
+extra_search -farsi +file_in_path +find_in_path +folding -footer +fork()
-gettext -hangul_input -iconv +insert_expand +jumplist -keymap -langmap
+libcall +linebreak +lispindent +listcmds +localmap +menu +mksession
+modify_fname +mouse -mouseshape -mouse_dec -mouse_gpm -mouse_jsbterm
-mouse_netterm +mouse_xterm -multi_byte +multi_lang -osfiletype +path_extra
-perl +postscript +printer -python +quickfix -rightleft -ruby +scrollbind
-signs +smartindent -sniff +statusline -sun_workshop +syntax +tag_binary
+tag_old_static -tag_any_white -tcl +terminfo +termresponse +textobjects +title
-toolbar +user_commands +vertsplit +virtualedit +visual +visualextra +viminfo
+vreplace +wildignore +wildmenu +windows +writebackup -X11 -xfontset -xim
-xterm_clipboard -xterm_save
system vimrc file: "$VIM/vimrc"
user vimrc file: "$HOME/.vimrc"
user exrc file: "$HOME/.exrc"
fall-back for $VIM: "/usr/local/share/vim"
Compilation:
gcc -c -I. -Iproto -DHAVE_CONFIG_H -I/usr/local/include -g -O2
Linking: gcc -L/usr/local/lib -o vim60 -ltermlib -ldl

jamongx의 이미지

-cscope 이렇게 되어있네용 다시 컴파일해서 설치해야겠네요 ㅎㅎ

용모수려 재색겸비

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.