Author Topic: Tagging from a GCC command line  (Read 3143 times)


  • New Community Member
  • Posts: 1
  • Hero Points: 0
Tagging from a GCC command line
« on: January 28, 2014, 06:08:17 PM »

I am new to slickedit, so please forgive me if this question has a simple answer.  I was wondering if slick edit has a way to create a tagging database from the command line arguments given to GCC.  For example, I'm trying to navigate the source code for the eCos operating system.   Similar to Linux, it has layers upon layers of macros for various cpus and architectures.  Most of it's source code doesn't apply to my project.  Many macros are reused across all the cpu architectures.

If slickedit were to do a static analysis of the code it would find the same macros for each cpu architecture.
The important things is that there are lots and lots of macros.  I don't want to have to create a special
file with my projects custom defines because there are too many of them.  Instead, ecos has a configuration tool
that build the Makefiles for each sub component in the build.

In my mind it would be easy to create a gcc wrapper script that Make would call instead of GCC directly.
This script would have all the -D defines and -I include paths use for each C file.  After recording this information, the script to just passes to GCC.  When the build is finished you would have the accurate defines for the build.  Then, some magical script could build the tag database from this information.

I imagine such a tool/script would be perfect for Linux kernel builds too.

Does this exist in slicked? 




  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 990
  • Hero Points: 44
Re: Tagging from a GCC command line
« Reply #1 on: January 30, 2014, 04:20:09 PM »
We don't have this entire workflow that you describe already baked into our tagging. But most of the pieces are there. The thorny part is the support for a whole series of different -D defines that you can switch between. We don't have support for that.

The cleanest way, for now, to do this would be to write a Slick-C macro that would either read in all the -I directory paths from your makefile, or pull them from the project settings XML in the SlickEdit project file(s) (.vpj files). Once you have that list you can stitch together the command line args (or build a list file) and invoke the make_tags Slick-C command. Once that tag file is built, it can be added to a project via the "Auto-Updated Tag Files" section.

So that "magical script" really has three separate steps, but all of this could be done in Slick-C.