Question on Valgrind

This is a discussion on Question on Valgrind within the C++ Programming forums, part of the General Programming Boards category; Hi everyone. I've tried using Valgrind to profile using callgrind. To get a symbol table I compile with the -g ...

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    52

    Question on Valgrind

    Hi everyone.

    I've tried using Valgrind to profile using callgrind. To get a symbol table I compile with the -g option and get it working on a simple program that uses no external libraries.. I however have to use it for a bigger project that uses an external library, and I compile it specifying the g option.. and it compiles but when I run kcachegrind on the output.. I can't view the source.. and time spent on each line. Does anyone know if I need to specify somethign else than the -g option for bigger projects?

    Thanks in advance,

    Ed.

  2. #2
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,159
    -g should be enough

    1) Make sure you're actually linking against the debug build of the library. If it's installed elsewhere on your system, maybe you're getting the wrong one.
    2) Make sure the library isn't getting stripped as some final step of its build process
    3) Make sure you are linking dynamically
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Alice....
    By Lurker in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 06-20-2005, 02:51 PM
  2. Debugging question
    By o_0 in forum C Programming
    Replies: 9
    Last Post: 10-10-2004, 05:51 PM
  3. Question about pointers #2
    By maxhavoc in forum C++ Programming
    Replies: 28
    Last Post: 06-21-2004, 12:52 PM
  4. Question...
    By TechWins in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 07-28-2003, 09:47 PM
  5. Question, question!
    By oskilian in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 12-24-2001, 12:47 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21