This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
debug info breaks build (Was: Re: Variable tracking (location lists support) - part 2)
- From: Joern Rennecke <joern dot rennecke at superh dot com>
- To: zlomj9am at artax dot karlin dot mff dot cuni dot cz (Josef Zlomek), dberlin at dberlin dot org (Daniel Berlin)
- Cc: roger at eyesopen dot com (Roger Sayle), gcc-patches at gcc dot gnu dot org
- Date: Mon, 9 Feb 2004 13:42:44 +0000 (GMT)
- Subject: debug info breaks build (Was: Re: Variable tracking (location lists support) - part 2)
The addition of location list support broke sh-elf and sh64-elf builds.
Presumably all targets with a non-empty USTER_LABEL_PREFIX and dwarf2
debugging information are affected.
The new .debug_loc section contains invalid differences:
.Letext0:
.section .debug_loc,"",@progbits
.Ldebug_loc0:
.LLST0:
.ualong 0xffffffff
.ualong _.text
.ualong .LVL0-_.text
.ualong .LVL2-_.text
This is from the assembly file generated for muldi3 for sh-elf.
Here is a backtrace from the generation of the first invalid difference:
#0 dw2_assemble_integer (size=4, x=0x402aa3c0)
at ../../srcw/gcc/dwarf2asm.c:50
#1 0x080e4c3f in dw2_asm_output_delta (size=4, lab1=0x83f7418 "*.LVL0",
lab2=0x830c42d ".text",
comment=0x830c4c0 "Location list begin address (%s)")
at ../../srcw/gcc/dwarf2asm.c:107
#2 0x080ef71f in output_loc_list (list_head=0x4028be10)
at ../../srcw/gcc/dwarf2out.c:6661
#3 0x080ee8cf in output_location_lists (die=0x40298b00)
at ../../srcw/gcc/dwarf2out.c:6168
#4 0x080ee8ff in output_location_lists (die=0x40298ac0)
at ../../srcw/gcc/dwarf2out.c:6171
#5 0x080ee8ff in output_location_lists (die=0x402097c0)
at ../../srcw/gcc/dwarf2out.c:6171
#6 0x080ff38d in dwarf2out_finish (
filename=0x83ee7b0 "../../srcw/gcc/libgcc2.c")
at ../../srcw/gcc/dwarf2out.c:13439
#7 0x0824f52e in compile_file () at ../../srcw/gcc/toplev.c:1858
#8 0x08254bcc in do_compile () at ../../srcw/gcc/toplev.c:4678
#9 0x08254c62 in toplev_main (argc=19, argv=0xbfffe324)
at ../../srcw/gcc/toplev.c:4718
#10 0x4004f507 in __libc_start_main (main=0x809e594 <main>, argc=19,
ubp_av=0xbfffe324, init=0x80494a0 <_init>, fini=0x82f7180 <_fini>,
rtld_fini=0x4000dc14 <_dl_fini>, stack_end=0xbfffe31c)
at ../sysdeps/generic/libc-start.c:129
AFAIKS the basic problem is that curr->section is used like a label in
output_loc_list, which has been introduced in Daniel Berlin's patch from
2001-05-18 (dwarf2out.c version 1.270), but this code has not been used
during sh-elf or sh64-elf builds before.
The current form of this code is:
if (strcmp (curr->section, ".text") == 0)
{
/* dw2_asm_output_data will mask off any extra bits in the ~0. */
dw2_asm_output_data (DWARF2_ADDR_SIZE, ~(unsigned HOST_WIDE_INT) 0,
"Location list base address specifier fake entry");
dw2_asm_output_offset (DWARF2_ADDR_SIZE, curr->section,
"Location list base address specifier base");
}
/* Walk the location list, and output each range + expression. */
for (curr = list_head; curr != NULL; curr = curr->dw_loc_next)
{
unsigned long size;
if (separate_line_info_table_in_use == 0)
{
dw2_asm_output_delta (DWARF2_ADDR_SIZE, curr->begin, curr->section,
"Location list begin address (%s)",
list_head->ll_symbol);
dw2_asm_output_delta (DWARF2_ADDR_SIZE, curr->end, curr->section,
"Location list end address (%s)",
list_head->ll_symbol);
}
curr->section is ".text" Since there is no leading '*', LOCAL_LABEL_PREFIX
gets applied, so that we end up with _.text .