This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: 3.0 bogus file information in debugging output
On Thu, Jan 31, 2002 at 04:34:43PM -0800, Zack Weinberg wrote:
> They are in now.
~/c++/libcw/src/libcwd/tests>cat lines.cc
#include <libcw/sysd.h>
#include <libcw/debug.h>
void print_line(void)
{
libcw::debug::location_ct loc((char*)__builtin_return_address(0) + libcw::debug::builtin_return_address_offset);
Dout(dc::notice, loc);
}
int main(void)
{
Debug( libcw_do.on() );
Debug( dc::bfd.on() );
Debug( dc::notice.on() );
int i = 0; print_line();
#line __LINE__ "foo.c"
i++; print_line();
#line __LINE__ "bar.c"
print_line(); return i;
}
~/c++/libcw/src/libcwd/tests>rm lines.o lines .libs/lines*
~/c++/libcw/src/libcwd/tests>g++-cvs-3.0 -DHAVE_CONFIG_H -I. -I../include -I./../include -DCWDEBUG -ggdb3 -pipe -pthread -Wall -Woverloaded-virtual -Wundef -Wpointer-arith -Wwrite-strings -Werror -Winline -c -o lines.o lines.cc
~/c++/libcw/src/libcwd/tests>g++-cvs-3.0 -DCWDEBUG -ggdb3 -pipe -pthread -Wall -Woverloaded-virtual -Wundef -Wpointer-arith -Wwrite-strings -Werror -Winline -Wl,-rpath -Wl,/home/carlo/c++/libcw/src/libcwd/.libs -o .libs/lines lines.o ../.libs/libcwd.so -lpthread -ldl
~/c++/libcw/src/libcwd/tests>./.libs/lines 2>&1 | grep NOTICE
NOTICE : lines.cc:16
NOTICE : foo.c:17
NOTICE : bar.c:18
(and the same result for stabs)
I suppose that is right?
I didn't know that the '#line' line didn't increment __LINE__.
Otherwise I'd have expected:
NOTICE : lines.cc:16
NOTICE : foo.c:17
NOTICE : bar.c:19
This compiler version gave me two testsuite failures in libcwd,
both were caused by:
#4 0x40070375 in libcw::debug::elf32::object_file_ct::load_dwarf() (this=0x80b5630) at elf32.cc:1519
1515 case 0: // Extended opcode.
1516 {
1517 uLEB128_t size; // Size in bytes.
1518 dwarf_read(debug_line_ptr, size);
1519 LIBCWD_ASSERT( size > 0 );
that assertion... I'll have to investigate what is going on.
--
Carlo Wood <carlo@alinoe.com>