From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10294 invoked by alias); 12 May 2008 19:46:42 -0000 Received: (qmail 10284 invoked by uid 22791); 12 May 2008 19:46:41 -0000 X-Spam-Check-By: sourceware.org Received: from mtagate6.de.ibm.com (HELO mtagate6.de.ibm.com) (195.212.29.155) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 12 May 2008 19:46:20 +0000 Received: from d12nrmr1607.megacenter.de.ibm.com (d12nrmr1607.megacenter.de.ibm.com [9.149.167.49]) by mtagate6.de.ibm.com (8.13.8/8.13.8) with ESMTP id m4CJjdvA133172 for ; Mon, 12 May 2008 19:45:39 GMT Received: from d12av02.megacenter.de.ibm.com (d12av02.megacenter.de.ibm.com [9.149.165.228]) by d12nrmr1607.megacenter.de.ibm.com (8.13.8/8.13.8/NCO v8.7) with ESMTP id m4CJjdVq3072040 for ; Mon, 12 May 2008 21:45:39 +0200 Received: from d12av02.megacenter.de.ibm.com (loopback [127.0.0.1]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m4CJjdAa031488 for ; Mon, 12 May 2008 21:45:39 +0200 Received: from tuxmaker.boeblingen.de.ibm.com (tuxmaker.boeblingen.de.ibm.com [9.152.85.9]) by d12av02.megacenter.de.ibm.com (8.12.11.20060308/8.12.11) with SMTP id m4CJjdYd031485; Mon, 12 May 2008 21:45:39 +0200 Message-Id: <200805121945.m4CJjdYd031485@d12av02.megacenter.de.ibm.com> Received: by tuxmaker.boeblingen.de.ibm.com (sSMTP sendmail emulation); Mon, 12 May 2008 21:45:39 +0200 Subject: Overlay support broken (Re: [patch] [2/2] Discontiguous PSYMTABs (psymtabs->symtabs by addrmap)) To: jan.kratochvil@redhat.com (Jan Kratochvil) Date: Mon, 12 May 2008 22:24:00 -0000 From: "Ulrich Weigand" Cc: gdb-patches@sources.redhat.com, drow@false.org In-Reply-To: <20080423213059.GC11894@host0.dyn.jankratochvil.net> from "Jan Kratochvil" at Apr 23, 2008 11:30:59 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-05/txt/msg00383.txt.bz2 Jan Kratochvil wrote: > * symtab.c: Include "addrmap.h" > (find_pc_sect_psymtab): Support reading the field PSYMTABS_ADDRMAP. > Move the psymtab locator into ... > (find_pc_sect_psymtab_closer): ... a new function. It appears this change broke overlay support. In fact, it looks like the main idea of this patch is fundamentally incompatible with overlays: > + /* Map addresses to the entries of PSYMTABS. It would be more efficient to > + have a map per the whole process but ADDRMAP cannot selectively remove > + its items during FREE_OBJFILE. This mapping is already present even for > + PARTIAL_SYMTABs which still have no corresponding full SYMTABs read. */ > + > + struct addrmap *psymtabs_addrmap; In the presence of overlays, a single address can map to *multiple* PSYMTABS corresponding to multiple overlay segments optionally loaded at that address. The old code chose between them using the "section" argument to find_pc_sect_psymtab; it seems the new code just ignores this argument: /* Try just the PSYMTABS_ADDRMAP mapping first as it has better granularity than the later used TEXTLOW/TEXTHIGH one. */ ALL_OBJFILES (objfile) if (objfile->psymtabs_addrmap != NULL) { struct partial_symtab *pst; pst = addrmap_find (objfile->psymtabs_addrmap, pc); if (pst != NULL) { /* We do not try to call FIND_PC_SECT_PSYMTAB_CLOSER as PSYMTABS_ADDRMAP we used has already the best 1-byte granularity and FIND_PC_SECT_PSYMTAB_CLOSER may mislead us into a worse chosen section due to the TEXTLOW/TEXTHIGH ranges overlap. */ return pst; } } Any suggestions how to fix this? Bye, Ulrich -- Dr. Ulrich Weigand GNU Toolchain for Linux on System z and Cell BE Ulrich.Weigand@de.ibm.com