From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14944 invoked by alias); 15 Sep 2002 15:43:37 -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 14937 invoked from network); 15 Sep 2002 15:43:36 -0000 Received: from unknown (HELO msgbas2.cos.agilent.com) (192.25.240.37) by sources.redhat.com with SMTP; 15 Sep 2002 15:43:36 -0000 Received: from relcos1.cos.agilent.com (relcos1.cos.agilent.com [130.29.152.239]) by msgbas2.cos.agilent.com (Postfix) with ESMTP id 3BEC520D2; Sun, 15 Sep 2002 09:43:36 -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 784AA504; Sun, 15 Sep 2002 09:43:15 -0600 (MDT) Received: from agilent.com (cos1nai128101.cos.agilent.com [141.184.128.101]) by websvr.canada.agilent.com (8.9.3 (PHNE_25183)/8.9.3 SMKit7.1.1_Agilent) with ESMTP id IAA14068; Sun, 15 Sep 2002 08:43:32 -0700 (PDT) Message-ID: <3D84AAAD.6090706@agilent.com> Date: Sun, 15 Sep 2002 08:43:00 -0000 From: Earl Chew Organization: Agilent Technologies User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, 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> <3D8269C8.8E33C4AC@agilent.com> <20020913225151.GA24869@nevyn.them.org> <3D8270FF.3086EA5C@agilent.com> <20020914013314.GB31038@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-09/txt/msg00190.txt.bz2 Daniel Jacobowitz wrote: > With any patches? And, did you check which of .mdebug/.stab you're > getting? Some patches for VxWorks compatibility, and yes, it's using .stabs. >>>This sounds like your GCC and binutils are out of sync, in fact. >> >>I'm pretty sure there's something wrong with gdb in this regard >>because end_symtab is being called with cstk->start_addr >>(succesfully relocated) and end_addr (not relocated). > > > One difference between stabs-in-mdebug and stabs-in-elf is whether line > and other addresses are relative to the beginning of the function or > absolute. A mismatch causes this symptom. If you're getting > stabs-in-ELF, I believe GCC 2.95 is not prepared for that. Daniel, I can now see why you are suspicious about my previous attempt at a fix. Thinking about the problem some more, I see that if my attempted patch were really the proper fix, this problem should manifest itself in all sites running gdb --- and clearly it doesn't. So I must be on the right track, but clearly, the patch isn't resolving the core of the problem. I'm running gdb like this: vxgdb> file c:/foo.dbg vxgdb> target remote 10.0.0.2:987 A consequence of the target command is that the remote is queried for qOffsets, and responds with the relocated addresses for .text, .data and .bss. The result of this is that objfile_relocate in objfiles.c is called to relocate the symbols. I can see this walking the partial symbols using ALL_OBJFILE_PSYMTABS. However, dbxread.c has private symbol information cached in read_symtab_private. The contents of this information is unknown to objfile_relocate, and hence it doesn't make any attempt to relocate it. I think the solution here is to provide another function pointer (eg relocate_symtab) to allow objfile_relocate to get this private information updated. So, I think objfiles.c needs to be changed to: { struct partial_symtab *p; ALL_OBJFILE_PSYMTABS (objfile, p) { p->textlow += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); p->texthigh += ANOFFSET (delta, SECT_OFF_TEXT (objfile)); p->relocate_symtab(p, delta); } } And the implementation for dbxread.c should be: static void dbx_relocate_symtab( struct partial_symtab* pst, struct section_offsets* delta) { TEXTLOW(pst) += ANOFFSET (delta, SECT_OFF_TEXT (pst->objfile)); TEXTHIGH(pst) += ANOFFSET (delta, SECT_OFF_TEXT (pst->objfile)); } Corresponding implementations are required in dwarf2read.c, hpread.c, mdebugread.c, os9kread.c and xcoffread.c. Some of these do not cache offsets the way dbxread.c does, so the relocation function can be empty. Earl