Monday, July 28, 2014

C++, Cygwin, Netbeans: tools

Problem 1. Breakpoints don't work.
Solution: run Netbeans with this command
"C:\Program Files\NetBeans 8.0\bin\netbeans.exe" -J-Dgdb.breakpoints.shortpaths=true

Problem 2. Profiling tool?
Solution: gprof
  1. Compile and link with the -pg option.
  2. Run your program normally
  3. Type gprof mysuperprogram > outputfile
  4. look description of the tables AFTER the table
Problem 3. Where from the function was called?

gprof output:
                                                 <spontaneous>
[5]     11.9    4.69    0.00                 std::string::assign(std::string const&) [5]

solution: use gdb with this nice cheat sheet
set breakpoint by name and then call where

No comments:

Post a Comment