This is the mail archive of the
mailing list for the GDB project.
Re: Debugging partially optimised code
- From: Tom Tromey <tromey at redhat dot com>
- To: Robert Lupton the Good <rhl at astro dot princeton dot edu>
- Cc: gdb at sourceware dot org
- Date: Tue, 28 Jun 2011 14:36:47 -0600
- Subject: Re: Debugging partially optimised code
- References: <612AB7BF-856F-4459-8DBA-D5060B4F1952@astro.princeton.edu>
>>>>> "Robert" == Robert Lupton the Good <email@example.com> writes:
Robert> I'm reasonably capable of debugging -O3 code, but sometimes you
Robert> really want the non-optimised version. However, after
Robert> recompiling just a couple of files -O0 and relinking (using g++
Robert> 4.4.6) I am having trouble.
Robert> In particular, setting a breakpoint within the non-optimised
Robert> routine results in a break in what is apparently the shared
Robert> object library (!?). I didn't think that gcc did link-time
Robert> optimisation (and I certainly didn't pass any -O flags to the
Robert> linker). Frame 1 is OK, but frame 0 certainly isn't what I
Robert> wanted; note that both SpatialModelPsf.cc and
Robert> algorithmsLib_wrap.cc were compiled -O0 (although other object
Robert> files in the linked libraries were linked -O3)
Robert> Any ideas?
There isn't enough information here to go on.
The problem could range from user error (sorry) to compiler bug to gdb
bug. It depends on various specifics that we don't know.