From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10631 invoked by alias); 13 Sep 2002 22:42:26 -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 10622 invoked from network); 13 Sep 2002 22:42:25 -0000 Received: from unknown (HELO msgbas2.cos.agilent.com) (192.25.240.37) by sources.redhat.com with SMTP; 13 Sep 2002 22:42:25 -0000 Received: from relcos1.cos.agilent.com (relcos1.cos.agilent.com [130.29.152.239]) by msgbas2.cos.agilent.com (Postfix) with ESMTP id 177A41ED2; Fri, 13 Sep 2002 16:42:25 -0600 (MDT) Received: from websvr.canada.agilent.com (websvr.canada.agilent.com [141.184.122.102]) by relcos1.cos.agilent.com (Postfix) with ESMTP id 39F32389; Fri, 13 Sep 2002 16:42:01 -0600 (MDT) Received: from agilent.com (dhcp6burnaby.canada.agilent.com [141.184.123.147]) by websvr.canada.agilent.com (8.9.3 (PHNE_25183)/8.9.3 SMKit7.1.1_Agilent) with ESMTP id PAA05533; Fri, 13 Sep 2002 15:42:19 -0700 (PDT) Message-ID: <3D8269C8.8E33C4AC@agilent.com> Date: Fri, 13 Sep 2002 15:42:00 -0000 From: Earl Chew Organization: Agilent Technologies X-Accept-Language: en MIME-Version: 1.0 To: Daniel Jacobowitz Cc: gdb@sources.redhat.com Subject: Re: Mystified by "Internal error: pc 0x89f21e10 read in psymtab, but not in symtab References: <3D825BB5.48CFAFAB@agilent.com> <20020913220110.GA22097@nevyn.them.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00168.txt.bz2 Daniel Jacobowitz wrote: > What debug information is produced by your toolchain - mdebug, I bet. > Mdebug support is a little on the rotting side because we don't have > anyone interested/willing to maintain it; and mdebug is a mighty > arcane format. So, I roll up my sleeves and start debugging gdb. I believe the compiler is producing stabs in elf. How can I check? The target is VxWorks using remote serial protocol with segment resolution using qOffset. I put in a couple of printfs, and notice that the block vectors have start > end. Oops. I put another breakpoint in end_symtab, and notice that it's being called from read_ofile_symtab in dbxread.c. At the end of this function, there's a line that reads: pst->symtab = end_symtab (text_offset + text_size, objfile, SECT_OFF_TEXT (objfile)); Looking at end_symtab in buildsym.c, I see: /* Make a block for the local symbols within. */ finish_block (cstk->name, &local_symbols, cstk->old_blocks, cstk->start_addr, end_addr, objfile); Printing cstk->start_addr, I see that this is the succesfully relocated address (somewhere at 0x8fxxxxxx), but end_addr is a small number --- obviously not relocated. Patching dbxread.c pst->symtab = end_symtab (text_offset + text_size + section_offsets->offsets[SECT_OFF_TEXT (objfile)], objfile, SECT_OFF_TEXT (objfile)); cures the problem. But I'm not sure if this patch should be applied to end_symtab() instead. I looked and end_symtab() is called from many places, and I don't have enough information to decide if they're right/wrong in the manner of dbxread.c. Earl