Source horribly out-of-sync

Brendan Dixon <[email protected]>
Newsgroups gmane.comp.gdb.general
Message-ID <BE6F417F.2EAD%[email protected]>
I am a relatively new user of GCC and GDB, though I¹ve used many, many other
compilers and debuggers over the years ­ including some very low-level ones.
I¹ve run into a problem, which is likely caused by my build (I suppose),
that I¹ve not yet been able to figure out: When I debug a static-library
I¹ve built using GDB, the source lines ­ including the referenced files ­
are horribly out of sync. For example, I will *known* that I¹m in, say,
A.CPP, but GDB reports me being at some odd line in B.CPP.

The static library is built using pretty normal, as far as I can tell, GCC
options: -ggdb3 ­O0 ­Wall ­frepo. The library is designed as part of an
Apache module I¹m writing, but I¹ve seen the same effect when
linking/debugging it within a small test harness. The code is relatively
clean ISO C++. It does have a few inline functions (mostly quick checks) and
uses a couple of templates (the auto_ptr and basic_string from the STL and a
modified form of auto_ptr I use for items not allocated through new). Other
than that, it¹s straightforward code. It does link in the Apache Portable
Runtime and LibXML2/XSLT, but I (more or less) treat those as black-boxes.

I¹m building on Mac OS X 10.3 (the latest Panther build) using the GCC and
GDB provided by Apple (GCC 3.3 and GDB 5.3).

I welcome any thoughts and suggestions. I do not subscribe to this list and
so would appreciate being cc¹d on any responses.

Thank you,
Brendan

_______________________________________________
Gdb mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gdb
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.