From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2721 invoked by alias); 30 Mar 2005 15:25:36 -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 2635 invoked from network); 30 Mar 2005 15:25:27 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 30 Mar 2005 15:25:27 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DGf5Y-00029s-Dq; Wed, 30 Mar 2005 10:26:36 -0500 Date: Wed, 30 Mar 2005 15:25:00 -0000 From: Daniel Jacobowitz To: "M.M. Kettenis" Cc: Jon Ringle , gdb@sources.redhat.com Subject: Re: arm core analysis on x86 host Message-ID: <20050330152636.GA7867@nevyn.them.org> Mail-Followup-To: "M.M. Kettenis" , Jon Ringle , gdb@sources.redhat.com References: <200503300928.36020.jon.ringle@comdial.com> <7320355463156182@weblx058.utsp.utwente.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7320355463156182@weblx058.utsp.utwente.nl> User-Agent: Mutt/1.5.6+20040907i X-SW-Source: 2005-03/txt/msg00302.txt.bz2 On Wed, Mar 30, 2005 at 03:10:31PM +0000, M.M. Kettenis wrote: > Secondly, the OS/ABI for core files don't have to match the executable > exactly, but of course they have to be somewhat compatible. I know > for sure that 32x64-bit cross debugging works on AMD64, and it is > assumed to be working on PowerPC too. There might be some nasty > side-effects though if you load a core file without the matching > executable. > > However, if the OS/ABI's differ, be aware that > regset_from_core_section() will be called for the OS/ABI of the core > file. That regset_from_core_section() will have to do the proper > translation on the register sets for the OS/ABI of the executable. > That OS/ABI can be determined from the regcache that is passed to > regset_from_core_section(). > > I'd suggest looking at the i386/amd64 *BSD code or NetBSD/sparc64 code > for good examples. How does this work? In amd64_init_abi, we only call set_gdbarch_regset_from_core_section if this OS/ABI has a registered gregset. So if the core file is not tagged as Linux, then the right OS/ABI's code will never be called. It looks to me from tracing this through on i386, that the reason it works is because foo-*-linux* configurations default to GDB_OSABI_LINUX and none of the OS/ABI sniffers trigger on the core file. An accident, basically. The reason this doesn't work for ARM is because the sniffer tags the core file as GDB_OSABI_ARM_APCS. I've been meaning to change the way ARM OS/ABI detection works, which will "fix" this as a side effect; I will move that up my list and try to do it today. But I'm left wondering about the overall design. How are we supposed to figure out what sort of core file we have? Is the target architecture required to arbitrate between possible subtarget core formats? Do the sniffers need to become cleverer - if that's even possible? -- Daniel Jacobowitz CodeSourcery, LLC