iveney / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

documentation about linking the code for better debugging with gdb #75

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. compiling gtest with ./configure ; make ; make install
2. using in one test file the gtest framework
3. gdb ./binary -tui

What is the expected output? What do you see instead?

the problem is when reaching main in particular this line
     testing::InitGoogleTest(&argc, argv);
I cannot step inside that line with gdb ?
gdb just tells me "No source"
does it have to do with the fact that gtest was not linked statically ?
if so,how do I uninstall it and compile it statically ?

What version of the product are you using? On what operating system?

debian linux.
gtest-1.1.0

Please provide any additional information below.

please provide this information in the documentation as I think it would be 
useful for someone using your framework

Original issue reported on code.google.com by stefan.p...@gmail.com on 29 Nov 2008 at 9:24

GoogleCodeExporter commented 9 years ago
You are using an installed copy of gtest ('make install').  When gtest is 
installed, 
only the header files and the compiled libraries are installed, so there won't 
be 
source files for debugging gtest itself.

Please try to use a local copy of gtest instead.  First 'make uninstall', then 
'make 
clean', and then 'make' again.

Please re-open the issue if this doesn't fix the problem.

Original comment by shiq...@gmail.com on 2 Dec 2008 at 5:13

GoogleCodeExporter commented 9 years ago
Allow me to clarify some. By default we do install unstripped binaries (so you 
get
the function name in gdb). Gdb is very smart about finding source files if they 
are
located at the expected relative path from the built binary. However, there is 
hope!
You can specify increased amounts of debugging information with CXXFLAGS to 
./configure:

  ./configure CXXFLAGS=-g3

The above will actually embed the entire source code into binaries, and should 
allow
gdb to follow everything.

Original comment by chandl...@gmail.com on 2 Dec 2008 at 8:40