[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #13 from drow at gcc dot gnu dot org 2008-03-21 19:30 --- Closing, then. -- drow at gcc dot gnu dot org changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution||WORKSFORME http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #12 from deuling at de dot ibm dot com 2008-03-20 13:01 --- The error disappeared :-) I neither changed the compiler nor anything else in the setup. I just rebuild neg_array and the error is gone. (gdb) br MAIN__ Breakpoint 1 at 0x80485bd: file neg_array.F, line 1. (gdb) I also have a different Directory Table now. With gfortran 4.1.2 the value "fortran" was seen in Directory Table ?!? (see comment #6) The Directory Table: ../../../gcc-4.3.0/libgfortran /home/deuling/gcc/gcc-4.3.0-build/./gcc/include The File Name Table: Entry Dir TimeSizeName 1 1 0 0 fmain.c 2 1 0 0 libgfortran.h 3 2 0 0 stddef.h This looks correct to me now. I have no idea what was the cause of that errors. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #11 from wilson at tuliptree dot org 2008-03-20 06:56 --- Subject: Re: Debug information for .debug_loc section incorrect deuling at de dot ibm dot com wrote: > --- Comment #6 from deuling at de dot ibm dot com 2008-03-18 16:52 > --- > ./readelf --debug-dump=line give I get a little different output on the executable you attached to the PR, but the same effective result that the filename is missing. The Directory Table is empty. The File Name Table: Entry Dir TimeSizeName 1 0 0 0 Oh, wait, after I pasted it in here I see that I have a non-printing control character which wasn't obvious earlier. Anyways, I don't see this problem when I compile the file myself. The filename is there in the .s file and in the .o file, and in the executable. So there seems to be something wrong with your setup. You could try tracking down exactly where it fails. Look for a ".file 1 tmp.F" directive in the .s file. Look at the readelf --debug-dump=line output for the .o file. We already know that it is missing in the executable. Depending on where it first goes missing, this is either a compiler problem, an assembler problem, or a linker problem. As before, I do not see any compiler or binutils problem here. Jim -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #10 from deuling at de dot ibm dot com 2008-03-19 08:48 --- I attached the binary compiled with gfortran 4.3 on x86. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #9 from deuling at de dot ibm dot com 2008-03-19 08:48 --- Created an attachment (id=15342) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15342&action=view) x86 binary (neg_array.F) with gfortran 4.3 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #8 from amodra at bigpond dot net dot au 2008-03-19 01:17 --- Can you attach the object file that has the odd file name entry? I can't reproduce this. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #7 from amodra at bigpond dot net dot au 2008-03-19 00:54 --- Following up on comment #4, it was this part of Nick's patch that fixed the --debug-dump=loc problem: "Correct list of attributes which can reference a location list." http://sourceware.org/ml/binutils/2007-11/msg00191.html hunk 1123,1137 that removed DW_AT_lower_bound and others. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #6 from deuling at de dot ibm dot com 2008-03-18 16:52 --- ./readelf --debug-dump=line give for gfortran 4.1.2: The Directory Table: fortran The File Name Table: EntryÂDir····Time···Size···Name 1····1······0······0······neg_array.F for gfortran 4.3: The Directory Table is empty. The File Name Table: EntryÂDir····Time···Size···Name 1····0······0······0······^A I think this is the reason that GDB is not able to recognize neg_array.F as a source code file. Thus it gives: (gdb) br MAIN__ Breakpoint 1 at 0x80485bd: file , line 1. I guess this is an error in DWARF ? -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #5 from deuling at de dot ibm dot com 2008-03-18 13:43 --- Hi, I build binutils from head and you're right. This issue is fixed: [EMAIL PROTECTED] binutils]$ ./readelf --debug-dump=loc ~/fortran/neg_array Contents of the .debug_loc section: Offset BeginEnd Expression 080485b4 080485b5 (DW_OP_breg4: 4) 080485b5 080485b7 (DW_OP_breg4: 8) 080485b7 0804868b (DW_OP_breg5: 8) 002c 08048690 08048694 (DW_OP_breg4: 4) 002c 08048694 0804869a (DW_OP_reg1) 002c 0804869a 0804869b (DW_OP_breg4: 4) 002c 0804869b 0804869d (DW_OP_breg4: 8) 002c 0804869d 080486db (DW_OP_breg5: 8) 002c -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #4 from wilson at tuliptree dot org 2008-03-17 23:32 --- Subject: Re: Debug information for .debug_loc section incorrect deuling at de dot ibm dot com wrote: > objdump -W says: > objdump: Error: Location lists in .debug_info section aren't in ascending > order! > As seen in comment #1 readelf also gives that error. AFAIK readelf does not > use BFD library as GDB and objdump do so I believe this is not an error > in BFD library. objdump and readelf have different code for parsing elf files, but they unfortunately use common code for dumping dwarf debug info. And this code was broken. It was fixed 2007-11-16. With mainline binutils there is no error here. It is broken in binutils-2.18 and earlier. From inspecting the debug info, I also don't see anything wrong. This looks like a gdb bug. It isn't clear how to reproduce the gdb problem. I don't see any problem with some simple gdb commands on the testcase. Jim -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #3 from deuling at de dot ibm dot com 2008-03-17 19:28 --- Hi Andrew, attached is my little test program I use. The error is seen both on x86 and PowerPC: * i686 i686 i386 GNU/Linux * ppc64 ppc64 ppc64 GNU/Linux following versions of binutils: x86: binutils-2.17.50.0.6-5.el5 PowerPC: binutils-2.17.50.0.12-4 objdump -W says: objdump: Error: Location lists in .debug_info section aren't in ascending order! Contents of the .debug_loc section: Offset BeginEnd Expression 080485b4 080485b5 (DW_OP_breg4: 4) 080485b5 080485b7 (DW_OP_breg4: 8) 080485b7 0804868b (DW_OP_breg5: 8) objdump: Warning: There is an overlap [0x2c - 0xfffe] in .debug_loc section. objdump: Warning: Offset 0xfffe is bigger than .debug_loc section size. objdump: Warning: There is a hole [0xfffe - 0x2c] in .debug_loc section. As seen in comment #1 readelf also gives that error. AFAIK readelf does not use BFD library as GDB and objdump do so I believe this is not an error in BFD library. I use GDB's current head. I also tried gdb-6.5-25.el5_1.1 and it also occurs. Regards, Markus Deuling -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #2 from deuling at de dot ibm dot com 2008-03-17 19:20 --- Created an attachment (id=15338) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15338&action=view) Fortran test program Fortran test program -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615
[Bug debug/35615] Debug information for .debug_loc section incorrect
--- Comment #1 from pinskia at gcc dot gnu dot org 2008-03-17 16:49 --- Do you have an example source which causes this issue? Also what target is this on (I figure it is either powerpc-linux-gnu or powerpc64-linux-gnu)? Also what version of gdb are you trying this with (it could be a bug in gdb after all)? Also what version of binutils are you using? Thanks, Andrew Pinski -- pinskia at gcc dot gnu dot org changed: What|Removed |Added Component|fortran |debug Keywords||wrong-debug http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35615