Description of problem: When setting a breakpoint on a specific function, the debugger crashes. Version-Release number of selected component (if applicable): GNU gdb (GDB) Fedora (7.1-28.fc13) How reproducible: build gcc from FSF trunk revision 160832. Steps to Reproduce: 1. get gcc sources from FSF trunk revision 160832, configure, build 'all-gcc' Well, I'll see if I can attach my cc1plus binary. 2. gdb --args ./cc1plus -fpreprocessed t.gk.ii -quiet -dumpbase t.c.gk -march=pentiumpro -mtune=generic -m32 -auxbase t -gtoggle -O2 -w -version -fcompare-debug=-gtoggle -fcompare-debug-second -o /dev/null -frandom-seed=0xad9564b2 -fdump-final-insns=t.gk.gkd 3. Enter the command: break add_new_name_mapping Actual results: (gdb) break add_new_name_mapping ../../gdb/breakpoint.c:6594: internal-error: expand_line_sal_maybe: Assertion `found' failed. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) Expected results: Setting breakpoint without complaint. Additional info: $ nm cc1plus|grep add_new_name_mapping 085be0b0 t add_new_name_mapping
Created attachment 430126 [details] cc1plus binary - compressed with xz
I can confirm that this fails with the upstream gdb as well.
*** Bug 618637 has been marked as a duplicate of this bug. ***
Post upstream: http://sourceware.org/ml/gdb-patches/2010-07/msg00533.html
This package has changed ownership in the Fedora Package Database. Reassigning to the new owner of this component.
One of the problems is that GDB tries to skip prologue even for -O2 -g code. There is no such reason as with -O2 -g the debug info is correct for each instructions. With -O0 -g there are frame-related absolute addresses of autovariables which is the reason GDB needs to skip the prologue to have valid location of such -O0 -g autovariables. -O2 -g code can be detected for a Compilation Unit if there is referenced any location list from that CU (suggested by GCC hackers). In such case skipping prologues should be disabled. Compilation Unit @ offset 0x90398e: <0><903999>: Abbrev Number: 1 (DW_TAG_compile_unit) <90399f> DW_AT_name : ../../gcc/gcc/tree-into-ssa.c <9039a3> DW_AT_comp_dir : /user/inria/fsf/160832/bld-2/gcc <1><91073a>: Abbrev Number: 69 (DW_TAG_subprogram) <91073b> DW_AT_name : add_new_name_mapping <2><910751>: Abbrev Number: 75 (DW_TAG_formal_parameter) <910752> DW_AT_name : new_tree <910759> DW_AT_type : <0x903ea5> <91075d> DW_AT_location : 0x59d960 (location list) ^^^^^^^^^^^^^^^ (gdb) break add_new_name_mapping -> (gdb) p/x original_pc $1 = 0x85be0bd 085be0b0 <add_new_name_mapping>: 85be0b0: 55 push %ebp 85be0b1: 89 e5 mov %esp,%ebp 85be0b3: 57 push %edi 85be0b4: 56 push %esi 85be0b5: 89 c6 mov %eax,%esi 85be0b7: 53 push %ebx 85be0b8: 89 d3 mov %edx,%ebx 85be0ba: 83 ec 4c sub $0x4c,%esp 85be0bd: 80 3d a0 8c ca 08 00 cmpb $0x0,0x8ca8ca0 ^^^^^^^ There are other problems but this is the first step which should make the problems at least no longer affecting this specific case.
[rfc, 7.3?] -O2 -g breakpoints internal error + prologue skipping http://sourceware.org/ml/gdb-patches/2011-04/msg00229.html
gdb-7.2.90.20110429-35.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/gdb-7.2.90.20110429-35.fc15
Package gdb-7.2.90.20110429-35.fc15: * should fix your issue, * was pushed to the Fedora 15 testing repository, * should be available at your local mirror within two days. Update it with: # su -c 'yum update --enablerepo=updates-testing gdb-7.2.90.20110429-35.fc15' as soon as you are able to. Please go to the following url: https://admin.fedoraproject.org/updates/gdb-7.2.90.20110429-35.fc15 then log in and leave karma (feedback).
gdb-7.2.90.20110429-36.fc15 has been submitted as an update for Fedora 15. https://admin.fedoraproject.org/updates/gdb-7.2.90.20110429-36.fc15
gdb-7.2.90.20110429-36.fc15 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.