From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29471 invoked by alias); 30 Dec 2003 22:19:59 -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 29464 invoked from network); 30 Dec 2003 22:19:58 -0000 Received: from unknown (HELO sadr.equallogic.com) (66.155.203.134) by sources.redhat.com with SMTP; 30 Dec 2003 22:19:58 -0000 Received: from sadr.equallogic.com (localhost.localdomain [127.0.0.1]) by sadr.equallogic.com (8.12.8/8.12.8) with ESMTP id hBUMJwf7009382 for ; Tue, 30 Dec 2003 17:19:58 -0500 Received: from deneb.dev.equallogic.com (deneb [172.16.1.99]) by sadr.equallogic.com (8.12.8/8.12.8) with ESMTP id hBUMJviu009377 for ; Tue, 30 Dec 2003 17:19:57 -0500 Received: from localhost.equallogic.com (localhost.localdomain [127.0.0.1]) by deneb.dev.equallogic.com (8.11.6/8.11.6) with ESMTP id hBUMJva00672 for ; Tue, 30 Dec 2003 17:19:57 -0500 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16369.64013.161868.574183@gargle.gargle.HOWL> Date: Tue, 30 Dec 2003 22:19:00 -0000 From: Paul Koning To: gdb@sources.redhat.com Subject: Looking for a gdb function to handle alias addresses X-SW-Source: 2003-12/txt/msg00287.txt.bz2 Gentlepeople, I'm working on a kernel dump analyzer integrated with gdb (similar to the corefile support -- but with a pile of added wrinkles many of which are specific to our particular platform). One thing we run into from time to time is that there are several legal addresses for the same object. The target is MIPS-based, so an obvious one is that a KSEG1 address (0xa0000000-0xbfffffff) aliases a KSEG0 address (KSEG1 - 0x02000000). Similarly, in MIPS64 there are 64-bit addresses of various forms that also alias, sometimes in more complex ways than simply a numeric bias. The ELF image of course has its symbols associated with one of these addresses, typically the KSEG0 address. As a result, when I'm dealing with an alias address, the mapping of address to symbol doesn't work right. It's easy to get the right data from the dump file, but for commands like "bt" to work, the symbol references have to come out right. So... is there a standard gdb hook (say, part of the gdbarch machinery) that is supposed to take an alias address and map it to the "canonical" form which is the one expected to be found in the symtab? I thought of tweaking gdbarch_frame_saved_pc, but then I end up with false (numeric) addresses showing up in "bt" -- the canonical ones rather than the ones that are really in the call stack. Is there a function that's called at a later spot, so I can get the raw addresses in the callstack and yet have them resolved to symbols correctly? Similarly, would that allow things like "disassemble " to work with the symbol names "correctly" shown in the disassembly output? If this doesn't currently exist, could anyone offer hints as to where such a beast could be added (and what form, roughly, it should take)? Thanks, paul