From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2838 invoked by alias); 1 Mar 2004 18:11:00 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 2826 invoked from network); 1 Mar 2004 18:10:59 -0000 Received: from unknown (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sources.redhat.com with SMTP; 1 Mar 2004 18:10:59 -0000 Received: from hiauly1.hia.nrc.ca (hiauly1.hia.nrc.ca [127.0.0.1] (may be forged)) by hiauly1.hia.nrc.ca (8.12.9-20030917/8.12.9) with ESMTP id i21IAwg4021151 for ; Mon, 1 Mar 2004 13:10:58 -0500 (EST) Received: (from dave@localhost) by hiauly1.hia.nrc.ca (8.12.9-20030917/8.12.9/Submit) id i21IAvB9021150 for gdb@sources.redhat.com; Mon, 1 Mar 2004 13:10:57 -0500 (EST) Received: from hiauly3.hia.nrc.ca (hiauly3.hia.nrc.ca [132.246.100.195]) by hiauly1.hia.nrc.ca (8.12.9-20030917/8.12.9) with ESMTP id i21I3ig4021015 for ; Mon, 1 Mar 2004 13:03:44 -0500 (EST) Received: from dns1.hia.nrc.ca (dns1.hia.nrc.ca [204.174.103.40]) by hiauly3.hia.nrc.ca (8.9.3 (PHNE_29774)/8.9.3) with ESMTP id NAA22557 for ; Mon, 1 Mar 2004 13:03:43 -0500 (EST) Received: from nrcmrdbh2.imsb.nrc.ca (nrcmrdbh2.imsb.nrc.ca [132.246.56.31]) by dns1.hia.nrc.ca (8.9.3/8.9.3/hiagate.mc Revision: 1.16) with ESMTP id KAA06616 for ; Mon, 1 Mar 2004 10:03:12 -0800 (PST) Received: by nrcmrdbh2.imsb.nrc.ca with Internet Mail Service (5.5.2657.72) id ; Mon, 1 Mar 2004 13:03:08 -0500 Received: from hiauly1.hia.nrc.ca ([132.246.100.193]) by nrcmrdbh1.imsb.nrc.ca with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2657.72) id FXJY0L5S; Mon, 1 Mar 2004 13:03:02 -0500 Received: from hiauly1.hia.nrc.ca (hiauly1.hia.nrc.ca [127.0.0.1] (may be forged)) by hiauly1.hia.nrc.ca (8.12.9-20030917/8.12.9) with ESMTP id i21I31g4021008; Mon, 1 Mar 2004 13:03:01 -0500 (EST) Received: (from dave@localhost) by hiauly1.hia.nrc.ca (8.12.9-20030917/8.12.9/Submit) id i21I30J6021006; Mon, 1 Mar 2004 13:03:00 -0500 (EST) Message-ID: <200403011803.i21I30J6021006@hiauly1.hia.nrc.ca> From: John David Anglin To: carlos@baldric.uwo.ca Cc: dave.anglin@nrc-cnrc.gc.ca, gdb@sources.redhat.com Subject: Re: gdb 6.0 Date: Mon, 01 Mar 2004 18:11:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-SW-Source: 2004-03/txt/msg00002.txt.bz2 High c., Have you started work on gdb? This weekend I was working on a patch for the GCC testsuite to make it correctly honor a preexisting LD_LIBRARY_PATH. This exposed a couple of problems related to dwarf2 exception support (e.g., g++.dg/eh/forced1.C). This test passes with sjlj exceptions but fails with dwarf2 exceptions. I started trying to debug this but found gdb dumps core trying to read the symbol table of libgcc_s.so.2 :( (gdb) sharedlibr /home/dave/gcc-3.5/objdir/gcc/libgcc_s.so.2 Reading symbols from /home/dave/gcc-3.5/objdir/gcc/libgcc_s.so.2...done. Loaded symbols for /home/dave/gcc-3.5/objdir/gcc/libgcc_s.so.2 Segmentation fault (core dumped) The details are: #0 decode_locdesc (blk=0x55cd, objfile=0x38b598, cu_header=0x0) at ../../gdb-6.0/gdb/dwarf2read.c:6771 #1 0x0012f2d0 in new_symbol (die=0x37e248, type=0x0, objfile=0x31ac08, cu_header=0xfaf01d08) at ../../gdb-6.0/gdb/dwarf2read.c:5210 #2 0x0012a08c in process_die (die=0x37e248, objfile=0x31ac08, cu_header=0xfaf01d08) at ../../gdb-6.0/gdb/dwarf2read.c:1835 #3 0x0012a7c0 in read_func_scope (die=0x37e1b0, objfile=0x31ac08, cu_header=0xfaf01d08) at ../../gdb-6.0/gdb/dwarf2read.c:2088 #4 0x0012a424 in read_file_scope (die=0x379ae0, objfile=0x31ac08, cu_header=0xfaf01d08) at ../../gdb-6.0/gdb/dwarf2read.c:1948 #5 0x00129be4 in psymtab_to_symtab_1 (pst=0x3694b0) at ../../gdb-6.0/gdb/dwarf2read.c:1702 #6 0x0012999c in dwarf2_psymtab_to_symtab (pst=0x3694b0) at ../../gdb-6.0/gdb/dwarf2read.c:1616 #7 0x0007b790 in psymtab_to_symtab (pst=0x3694b0) at ../../gdb-6.0/gdb/symfile.c:304 #8 0x00077f4c in find_pc_sect_symtab (pc=1075639268, section=0x0) at ../../gdb-6.0/gdb/symtab.c:1844 ... (gdb) p blk $1 = (struct dwarf_block *) 0x55cd (gdb) printf "0x%x\n",$pcoqh 0x131c73 (gdb) disass 0x131c60 0x131c80 Dump of assembler code from 0x131c60 to 0x131c80: 0x00131c60 : stw r6,-40(,sp) 0x00131c64 : stw r5,-3c(,sp) 0x00131c68 : stw r4,-38(,sp) 0x00131c6c : stw r3,-34(,sp) 0x00131c70 : ldw 0(,r26),r7 0x00131c74 : copy r25,r8 0x00131c78 : addil 21000,dp,%r1 0x00131c7c : copy r1,r12 End of assembler dump. (gdb) ptype blk type = struct dwarf_block { unsigned int size; char *data; } * (gdb) info addr blk Symbol "blk" is an argument in register r26. (gdb) p *die $4 = {tag = DW_TAG_formal_parameter, has_children = 0, abbrev = 31, offset = 63577, num_attrs = 5, attrs = 0x37e270, next_ref = 0x0, next = 0x37e2b0, type = 0x0} (gdb) p die->attrs[0] $5 = {name = DW_AT_name, form = DW_FORM_strp, u = {str = 0x34a278 "encoding", blk = 0x34a278, unsnd = 3449464, snd = 3449464, addr = 3449464}} (gdb) p die->attrs[1] $6 = {name = DW_AT_decl_file, form = DW_FORM_data1, u = { str = 0x1
, blk = 0x1, unsnd = 1, snd = 1, addr = 1}} (gdb) p die->attrs[2] $7 = {name = DW_AT_decl_line, form = DW_FORM_data1, u = { str = 0x4a
, blk = 0x4a, unsnd = 74, snd = 74, addr = 74}} (gdb) p die->attrs[3] $8 = {name = DW_AT_type, form = DW_FORM_ref4, u = { str = 0x45
, blk = 0x45, unsnd = 69, snd = 69, addr = 69}} (gdb) p die->attrs[4] $9 = {name = DW_AT_location, form = DW_FORM_data4, u = { str = 0x55cd
, blk = 0x55cd, unsnd = 21965, snd = 21965, addr = 21965}} The misaligned address for "blk" comes from the above. I know next to nothing about the dwarf2 encoding but I would guess that the symbol table is wrong, although it might be a problem in dwarf2read.c. This was with gdb-6.0-2. Thoughts? I think I will build GCC with -gstabs so I can debug the forced1.C problem. Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602)