This is the mail archive of the
mailing list for the GDB project.
Debugging partially optimised code
- From: Robert Lupton the Good <rhl at astro dot princeton dot edu>
- To: gdb at sourceware dot org
- Date: Tue, 14 Jun 2011 15:00:39 -0400
- Subject: Debugging partially optimised code
I'm reasonably capable of debugging -O3 code, but sometimes you really want the non-optimised version. However, after recompiling just a couple of files -O0 and relinking (using g++ 4.4.6) I am having trouble.
In particular, setting a breakpoint within the non-optimised routine results in a break in what is apparently the shared object library (!?). I didn't think that gcc did link-time optimisation (and I certainly didn't pass any -O flags to the linker). Frame 1 is OK, but frame 0 certainly isn't what I wanted; note that both SpatialModelPsf.cc and algorithmsLib_wrap.cc were compiled -O0 (although other object files in the linked libraries were linked -O3)
(gdb) b SpatialModelPsf.cc:182
(gdb) f 0
#0 0x00002aaabe78824e in std::pair<boost::shared_ptr<lsst::afw::math::LinearCombinationKernel>, std::vector<double, std::allocator<double> > > lsst::meas::algorithms::createKernelFromPsfCandidates<float>(lsst::afw::math::SpatialCellSet const&, int, int, int, int, bool) ()
(gdb) f 1
#1 0x00002aaabe2f7e72 in _wrap_createKernelFromPsfCandidates__SWIG_3 (args=0x25689a8)
13862 result = lsst::meas::algorithms::SWIGTEMPLATEDISAMBIGUATOR createKernelFromPsfCandidates< float >((lsst::afw::math::SpatialCellSet const &)*arg1,arg2,arg3,arg4,arg5,arg6);