From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5025 invoked by alias); 9 Jul 2003 18:08:08 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 5012 invoked from network); 9 Jul 2003 18:08:08 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 9 Jul 2003 18:08:08 -0000 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 19aJMH-0006Dz-00; Wed, 09 Jul 2003 14:08:01 -0400 Date: Wed, 09 Jul 2003 18:08:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: mludvig@suse.cz, gdb-patches@sources.redhat.com Subject: Re: [RFA] Re: Analyzing AMD64 corefiles on i386 Message-ID: <20030709180801.GA23865@nevyn.them.org> Mail-Followup-To: Mark Kettenis , mludvig@suse.cz, gdb-patches@sources.redhat.com References: <3F0ABC85.1080700@suse.cz> <200307081445.h68EjBWJ000503@elgar.kettenis.dyndns.org> <3F0BF66A.3080203@suse.cz> <200307091338.h69Dc8u7023807@elgar.kettenis.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200307091338.h69Dc8u7023807@elgar.kettenis.dyndns.org> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-07/txt/msg00185.txt.bz2 On Wed, Jul 09, 2003 at 03:38:08PM +0200, Mark Kettenis wrote: > Date: Wed, 09 Jul 2003 13:03:06 +0200 > From: Michal Ludvig > > This is a multi-part message in MIME format. > --------------050406070409000508090803 > Content-Type: text/plain; charset=us-ascii; format=flowed > Content-Transfer-Encoding: 7bit > > Mark Kettenis told me that: > > Date: Tue, 08 Jul 2003 14:43:49 +0200 > > From: Michal Ludvig > > > > Hi, > > what must be done to enable reading of AMD64 corefiles in a gdb running > > on i386 with --target=amd64? > > > > The necessary support for corefiles needs to be added to > > x86-64-linux-tdep.c. Take a look at i386nbsd-tdep.c for an example. > > You'll need to create a `struct core_fns' together with the necessary > > support functions, and register it with add_core_fns. Note that for > > the support functions you can't rely on definitions in header files > > and such since this is target code. You'll also need to drop > > core-regset.o from NATDEPFILES in x86-64-linux.mh. > > How about the attached one? Works for me on cross-gdb i386->amd64 as > well as in native amd64 gdb. Can I apply it? > > Not as such. We can't allow public functions with the names > supply_gregset and fill_gregset in *-tdep.c files. Therefore these > functions should be renamed, and supply_gregset and fill_gregset > should be kept in your *-nat.c file. You'll probably want to rewrite > those functions such that they call the new functions in *-tdep.c. I don't see the harm. They need to be multi-arched instead of called by name, eventually, but it's no extra work to rename them at that time. But that's just my personal opinion. > Personally I wouldn't define all those constants if the only place > where they'll be used is the regmap array, but that's a matter of > taste. I'm guessing it makes it easier to at-a-glance compare with . I did the same thing. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer