Loading ...
Sorry, an error occurred while loading the content.

Re: Using cscope with Vim source

Expand Messages
  • Sergey Khorev
    ... Yes, it will. But I think Vim source code is too small to make the difference critical. ... I ve been hardly using cscope last few years but this seems
    Message 1 of 8 , Jun 8, 2009
    • 0 Attachment
      Tony Mechelynck wrote:

      > Ah, I see, thanks. If I invoke cscope -b again with the same arguments,
      > and the database exists, will it "run faster" acording to which sources
      > have been updated and which ones haven't, as mentioned near the top of
      > the manpage?

      Yes, it will. But I think Vim source code is too small to make the difference critical.

      > If I got the list of files right, and since it is rather complex, it
      > would be nice to have a "cscope" and/or "cscope.out" target in the
      > src/Makefile, don't you think?

      I've been hardly using cscope last few years but this seems useful.

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_dev" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Lech Lorens
      ... I execute cscope as: cscope -qbk ./*.[ch] ./perl.xs auto/*.h auto/pathdef.c proto/*.pro (note the header files proto/*.pro). In the cscope invocation -q
      Message 2 of 8 , Jun 8, 2009
      • 0 Attachment
        2009/6/8 Tony Mechelynck <antoine.mechelynck@...>:
        >
        > I tried to understand how to use cscope (with the Vim source as a set of
        > sources to apply it to). Bram, correct me if I'm wrong.
        >
        > The following assumes $VIMSRC has been set (e.g. in the vimrc) to the
        > top-level directory of the Vim source & runtime distribution (on my
        > system, currently ~/.build/vim/vim72 )
        >
        > - First of all, build the database (done once).
        >
        >        :new
        >        :lcd $VIMSRC/src
        >        :!cscope -bv ./*.[ch] ./perl.xs auto/*.h auto/pathdef.c

        I execute cscope as:
        cscope -qbk ./*.[ch] ./perl.xs auto/*.h auto/pathdef.c proto/*.pro
        (note the header files proto/*.pro).
        In the cscope invocation -q allegedly makes the database lookups
        faster, and -k is responsible for not using the system header files
        (i.e. the ones lying in /usr/include)

        --
        Cheers,
        Lech

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_dev" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Dominique Pellé
        ... Seems OK. I also use option -q (see man cscope). ... You often don t need to rebuild cscope DB if the code changes slightly. But if some functions are
        Message 3 of 8 , Jun 8, 2009
        • 0 Attachment
          Tony Mechelynck skribis:

          > I tried to understand how to use cscope (with the Vim source as a set of
          > sources to apply it to). Bram, correct me if I'm wrong.
          >
          > The following assumes $VIMSRC has been set (e.g. in the vimrc) to the
          > top-level directory of the Vim source & runtime distribution (on my
          > system, currently ~/.build/vim/vim72 )
          >
          > - First of all, build the database (done once).
          >
          >        :new
          >        :lcd $VIMSRC/src
          >        :!cscope -bv ./*.[ch] ./perl.xs auto/*.h auto/pathdef.c

          Seems OK. I also use option -q (see man cscope).

          > I have searched the src/Makefile for a target doing this kind of stuff
          > (the way the tags target builds a Vim tagfile for the same source) but
          > have failed.
          >
          > It's not clear to me whether to repeat this after the sources change,
          > I'll have to read the cscope manpage in more detail (it seems to say
          > cscope is clever enough to update the database if the sources have
          > changed, but can I rely on that?)

          You often don't need to rebuild cscope DB if the code changes slightly.
          But if some functions are added to vim sourrce code for example, it's
          nicer to rebuild cscope DB or else you won't find the new functions
          for example. Vim source code is small anyway so rebuilding cscope DB
          is very fast.

          > BTW, here "cscope --version" anwsers:
          > cscope: version 15.6

          On http://sourceforge.net/projects/cscope/, I see that the
          latest version is 15.7a, last update: Apr 30 2009.

          On my machine, I see:
          $ cscope --version
          cscope: version 16.0a

          So I'm a bit puzzled since 16.0a is newer than what website says.
          I don't remember when I built cscope. Maybe it was from a CVS
          snapshot.


          > - Once per session (done manually when starting to use it). First two
          > lines are of course not needed if already done by building the database
          > as shown above. Last line (setting 'cscopequickfix') can be in vimrc. It
          > is of course the "useful setting" given at ":help csqf" with no quotes
          > (also no single quotes around 'csqf').
          >
          >        :new
          >        :lcd $VIMSRC/src
          >        :cs add cscope.out
          >        " use quickfix for most common queries
          >        :set csqf=s-,c-,d-,i-,t-,e-

          In my ~/.vimrc, I have:

          if has('cscope')
          if filereadable(expand("$HOME/cscope.out"))
          cs kill -1
          cs add ~/cscope.out
          endif
          set cscopeverbose

          " Put output of cscope in quickfix window (use :copen)
          set cscopequickfix=s-,c-,d-,i-,t-,e-,g-
          endif

          The "cs kill -1" is there to ensure that I don't get an error reloading
          the cscope DB in case I source my ~/.vimrc several times. You
          can find my .vimrc at: http://dominique.pelle.free.fr/.vimrc.html

          Regards
          -- Dominique

          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_dev" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • David Fishburn
          2009/6/8 Dominique Pellé : ... Looks like you downloaded it from here (as I did): http://iamphet.nm.ru/cscope/index.html This was a
          Message 4 of 8 , Jun 8, 2009
          • 0 Attachment
            2009/6/8 Dominique Pellé <dominique.pelle@...>:
            ...
            >> BTW, here "cscope --version" anwsers:
            >> cscope: version 15.6
            >
            > On http://sourceforge.net/projects/cscope/, I see that the
            > latest version is 15.7a, last update: Apr 30 2009.
            >
            > On my machine, I see:
            >  $ cscope --version
            >  cscope: version 16.0a
            >
            > So I'm a bit puzzled since 16.0a is newer than what website says.
            > I don't remember when I built cscope.  Maybe it was from a CVS
            > snapshot.

            Looks like you downloaded it from here (as I did):
            http://iamphet.nm.ru/cscope/index.html

            This was a special version to make it work with Vim's internal support
            to work with Win32 (that is at least why I have it).
            See :h cscope-win32

            Dave

            --~--~---------~--~----~------------~-------~--~----~
            You received this message from the "vim_dev" maillist.
            For more information, visit http://www.vim.org/maillist.php
            -~----------~----~----~----~------~----~------~--~---
          • Sergey Khorev
            ... Not necessarily. That Win32 build has version 16.0a because version number in CVS was 16.0a So either Dominique uses my Win32 build or built cscope from
            Message 5 of 8 , Jun 9, 2009
            • 0 Attachment
              >> On my machine, I see:
              >> $ cscope --version
              >> cscope: version 16.0a
              >>
              >> So I'm a bit puzzled since 16.0a is newer than what website says.
              >> I don't remember when I built cscope. Maybe it was from a CVS
              >> snapshot.
              >
              > Looks like you downloaded it from here (as I did):
              > http://iamphet.nm.ru/cscope/index.html
              >
              > This was a special version to make it work with Vim's internal support
              > to work with Win32 (that is at least why I have it).

              Not necessarily. That Win32 build has version 16.0a because version
              number in CVS was 16.0a

              So either Dominique uses my Win32 build or built cscope from CVS.

              --
              Sergey Khorev
              http://iamphet.nm.ru
              Can anybody think of a good tagline I can steal?

              --~--~---------~--~----~------------~-------~--~----~
              You received this message from the "vim_dev" maillist.
              For more information, visit http://www.vim.org/maillist.php
              -~----------~----~----~----~------~----~------~--~---
            Your message has been successfully submitted and would be delivered to recipients shortly.