From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20080 invoked by alias); 16 Nov 2005 16:14:09 -0000 Received: (qmail 20014 invoked by uid 22791); 16 Nov 2005 16:14:06 -0000 Received: from sibelius.xs4all.nl (HELO sibelius.xs4all.nl) (82.92.89.47) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 16 Nov 2005 16:14:06 +0000 Received: from elgar.sibelius.xs4all.nl (root@elgar.sibelius.xs4all.nl [192.168.0.2]) by sibelius.xs4all.nl (8.13.4/8.13.4) with ESMTP id jAGGE30s020557; Wed, 16 Nov 2005 17:14:03 +0100 (CET) Received: from elgar.sibelius.xs4all.nl (kettenis@localhost.sibelius.xs4all.nl [127.0.0.1]) by elgar.sibelius.xs4all.nl (8.13.4/8.13.3) with ESMTP id jAGGE2b3000346; Wed, 16 Nov 2005 17:14:02 +0100 (CET) Received: (from kettenis@localhost) by elgar.sibelius.xs4all.nl (8.13.4/8.13.4/Submit) id jAGGE20h024643; Wed, 16 Nov 2005 17:14:02 +0100 (CET) Date: Wed, 16 Nov 2005 16:14:00 -0000 Message-Id: <200511161614.jAGGE20h024643@elgar.sibelius.xs4all.nl> From: Mark Kettenis To: randolph@tausq.org CC: gdb@sources.redhat.com In-reply-to: <437B53B4.5000906@tausq.org> (message from Randolph Chung on Wed, 16 Nov 2005 23:43:48 +0800) Subject: Re: Question about ELF core file sections References: <437B53B4.5000906@tausq.org> Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2005-11/txt/msg00320.txt.bz2 > Date: Wed, 16 Nov 2005 23:43:48 +0800 > From: Randolph Chung > > I'm trying to get core file support working on hppa64-hp-hpux11.11. I'm > trying to reuse the infrastructure from corelow.c and the "new" > regset_from_core_section() interface, but I'm a bit confused about how > it's supposed to work. > > corelow.c:get_core_registers() is hardcoded to look for registers in > sections ".reg", ".reg2", ".reg-xfp" -- are these section names somehow > standard? I don't find these documented in the ELF specs. I see that on > Linux variants, this ".reg" section is actually synthesized by bfd. This > all seems to be a bit convoluted :( The names are largely hostoric (and I'd really like to rename ".reg2" to something more sensible). The mechanism is there more for the benefit of binutils than for gdb I think. By synthesising those section you can inspect and manipulate them with objdump for example. > On HPUX, there is a program header type HP_CORE_PROC that points to a > datastructure with the register info. Is there anyway to use the > existing interface to get to this info? If not, it looks like I can get > it to work using core_vec, but that uses an interface that is marked > deprecated.... You'll need to write code in BFD to synthesise the ".reg" and ".reg2" sections. Code for 32-bit HP-UX (SOM) code files is already there in bfd/hpux-core.c, but that code doesn't work for cross debugging. > Any hints and help appreciated... I think m68kbsd-tdep.c provides a pretty clean implementation implementation of what needs to implemented on gdb's side. Take a look at m68kbsd_supply_fpregset() and m68kbsd_supply_gregset(), how they're used in m68kbsd_gregset and m68kbsd_fpregset, and check out m68kbsd_regset_from_core_section. Cheers, Mark