|
From: Bjoern D. <bjo...@go...> - 2011-05-16 04:05:30
|
Hi all, using cscope on the Valgrind source seems to be tricky due to Valgrind's VG_() macros which confuse cscope's function parsing. Does anyone have a trick to work around that? Cheers, Bjoern |
|
From: Maynard J. <may...@us...> - 2011-05-16 21:25:28
|
Bjoern Doebel wrote: > Hi all, > > using cscope on the Valgrind source seems to be tricky due to > Valgrind's VG_() macros which confuse cscope's function parsing. Does > anyone have a trick to work around that? Eclipse CDT handles those very nicely. Also, a lot of indexing fixes have been made in the last few CDT releases, as I understand. Eclipse makes it a lot easier to navigate around a project as big and complex as valgrind. -Maynard > > Cheers, > Bjoern > > ------------------------------------------------------------------------------ > Achieve unprecedented app performance and reliability > What every C/C++ and Fortran developer should know. > Learn how Intel has extended the reach of its next-generation tools > to help boost performance applications - inlcuding clusters. > http://p.sf.net/sfu/intel-dev2devmay > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |
|
From: Nicholas N. <n.n...@gm...> - 2011-06-01 05:19:37
|
On Mon, May 16, 2011 at 2:05 PM, Bjoern Doebel <bjo...@go...> wrote: > Hi all, > > using cscope on the Valgrind source seems to be tricky due to > Valgrind's VG_() macros which confuse cscope's function parsing. Does > anyone have a trick to work around that? It confuses the hell out of various tags programs too. We should have used VG_. Even VGXYZ_ would be the same length as VG_(). Nick |
|
From: Philippe W. <phi...@sk...> - 2011-06-01 08:56:03
|
>> using cscope on the Valgrind source seems to be tricky due to
>> Valgrind's VG_() macros which confuse cscope's function parsing. Does
>> anyone have a trick to work around that?
>
> It confuses the hell out of various tags programs too. We should have
> used VG_. Even VGXYZ_ would be the same length as VG_().
>
> Nick
Emacs TAGS can reasonably be built with the below script.
The result TAGS works e.g. for M-x find-tag VG_(xxxx) or vg_(xxxx) or xxxx
If a significant proportion of Valgrind developpers are emacs users,
it might be worth adding the below script in SVN and
change the Makefile machinery to use it.
(the miracle by which the tags target appears in Makefile.in and Makefile
is however beyond me).
#! /bin/sh
# start a TAGS file from scratch with c and cpp files.
find . -name '*.c' -o -name '*.h' -o -name '*.cpp' |
etags --regex="{c}/[a-zA-Z][^ ]* *\(VG_(.*)\)/\1/" \
--regex="{c}/[a-zA-Z][^ ]* *\(CLG_(.*)\)/\1/" \
--regex="{c}/[a-zA-Z][^ ]* *\(MC_(.*)\)/\1/" \
--regex="{c}/[a-zA-Z][^ ]* *\(HG_(.*)\)/\1/" \
--regex="{c}/[a-zA-Z][^ ]* *\(DRD_(.*)\)/\1/" \
-
# add the Makefiles
find . -name 'Makefile*.am' |
etags --append --language=makefile -
# add the documentation files.
# We could build regex tags but which one ?
# In the meantime, this allows tags-search to work also on these files
find . -name '*.xml' |
etags --append --language=none -
|
|
From: Dave G. <go...@mc...> - 2011-06-01 15:01:50
|
On Jun 1, 2011, at 3:55 AM CDT, Philippe Waroquiers wrote:
>>> using cscope on the Valgrind source seems to be tricky due to
>>> Valgrind's VG_() macros which confuse cscope's function parsing. Does
>>> anyone have a trick to work around that?
>>
>> It confuses the hell out of various tags programs too. We should have
>> used VG_. Even VGXYZ_ would be the same length as VG_().
>>
>> Nick
>
> Emacs TAGS can reasonably be built with the below script.
[...]
> etags --regex="{c}/[a-zA-Z][^ ]* *\(VG_(.*)\)/\1/" \
> --regex="{c}/[a-zA-Z][^ ]* *\(CLG_(.*)\)/\1/" \
> --regex="{c}/[a-zA-Z][^ ]* *\(MC_(.*)\)/\1/" \
> --regex="{c}/[a-zA-Z][^ ]* *\(HG_(.*)\)/\1/" \
> --regex="{c}/[a-zA-Z][^ ]* *\(DRD_(.*)\)/\1/" \
> -
Here's a similar argument that I pass to exuberant ctags when running it on MPICH2:
'--regex-c=/PREPEND_PREFIX\( *([A-Za-z0-9_$@]*) *\)/MPID_\1/'
So identifiers wrapped in the PREPEND_PREFIX namespacing macro will end up in the tag file prefixed with "MPID_", which is the usual expansion of "PREPEND_PREFIX".
I use cscope primarily, but I still haven't found a way to fix it for this situation short of hacking on the cscope source (which I haven't done yet). If you use cscope with vim it will fall through to ctags if it fails to find a match for simple tag queries (CTRL-] or ":tag blah"), so I generate both a cscope DB and a ctags file and everything more or less works for common queries.
-Dave
|