Author Topic: Purify Configuration  (Read 6817 times)

aoehlke

  • Community Member
  • Posts: 48
  • Hero Points: 1
Purify Configuration
« on: August 27, 2006, 05:03:15 PM »
Hi, I am trying to create a Purify Configuration for my slick edit project(to go along with Release and Debug).

I have done this, and am now trying to override the GNU C options for the Purify configuration so that the link and compile directive contain the necessary options to have purify instrument the code.
An example of what needs to be added to the g++ line is : purify g++=true -g ... g++ (where ... is a whole bunch of purify specific switches).
When I make this change via the slick edit gui, GNU C options dialog, it always inserts double quotes at the start and end of the command line.
i.e. the above becomes "purify g++=true -g .. g++".
This then seems to cause the build command to not work properly... it creates .o files, but never an executable.
It doest generate any kind of error, and the build dialog even shows "build successful", but no executable is created.
However, if I modify the .vpj file by hand, and insert the command line args myself, WITHOUT the " ", it works.
I dont like this hack... and I am wondering if I am not doing something correctly, or if this is a bug, or, if anyone out there knows how to create a configuration for purify tool that works.  Note that with my modification by hand, if I then subsequently opewn the GNU C options dilaog, it inserts double quotes again, so I have to steer clear of that dialog once the modification has been made to the .vpj file.


Dennis

  • Senior Community Member
  • Posts: 3954
  • Hero Points: 515
Re: Purify Configuration
« Reply #1 on: August 28, 2006, 02:00:15 PM »
I am guessing that you tried to put replace (ignore quotes) "g++" with "purify g++=true -g" in the Compiler and/or Linker fields of the GNU C Options dialog.   That dialog is expecting those fields to contain the name of the command to execute -- without any options.  It quotes "purify g++=true -g" because, it assumes you are trying to run some program with spaces in it's name.

Since the GNU C Options GUI has limited flexibility with placement of options, the simplest solution to this is to create a small shell script for yourself, like "pureg++" like below:

Code: [Select]
#!/bin/sh
purify g++=true -g $*

Then you can point "compiler" and "linker" to this script for your Purify configuration and you should be off and running.

--Dennis

aoehlke

  • Community Member
  • Posts: 48
  • Hero Points: 1
Re: Purify Configuration
« Reply #2 on: August 28, 2006, 03:00:33 PM »
OK, this sounds promising, but what I really need to set the command to is:

purify g++=yes -demangle-program=/usr/sepp/bin/c++filt g++ -g -Wall -o "$(OUTFILE)" $(ALL_OBJ)

And I think outfile and ALL_OBJ are slick edit specific aliases?
would it still work if my pureg++ contains the above line?


Dennis

  • Senior Community Member
  • Posts: 3954
  • Hero Points: 515
Re: Purify Configuration
« Reply #3 on: August 28, 2006, 03:07:53 PM »
It looks to me that everything beyond "g++" is the same stuff you would normally pass to g++, so if "pureg++" were the following, I think you would be set.  FYI, if you are not familiar with Bourne shell, $* is an alias for the list of command line arguments.

Code: [Select]
#!/bin/sh
purify g++=yes -demangle-program=/usr/sepp/bin/c++filt g++ $*

aoehlke

  • Community Member
  • Posts: 48
  • Hero Points: 1
Re: Purify Configuration
« Reply #4 on: August 28, 2006, 03:26:18 PM »
this worked... excellent!

given your comments about bash shell, is this the shell that slickedit invokes itself(when using the built in shell)?
I ask because my personal login shell is tcsh.
not that it matters, just curious.

Or does the bash part only matter when running the pureg++ script itself.