From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22628 invoked by alias); 9 Jul 2003 13:38:21 -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 22583 invoked from network); 9 Jul 2003 13:38:09 -0000 Received: from unknown (HELO walton.kettenis.dyndns.org) (62.163.169.212) by sources.redhat.com with SMTP; 9 Jul 2003 13:38:09 -0000 Received: from elgar.kettenis.dyndns.org (elgar.kettenis.dyndns.org [192.168.0.2]) by walton.kettenis.dyndns.org (8.12.6p2/8.12.5) with ESMTP id h69Dc88E002543; Wed, 9 Jul 2003 15:38:08 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: from elgar.kettenis.dyndns.org (localhost [127.0.0.1]) by elgar.kettenis.dyndns.org (8.12.6p2/8.12.6) with ESMTP id h69Dc8Zb023810; Wed, 9 Jul 2003 15:38:08 +0200 (CEST) (envelope-from kettenis@elgar.kettenis.dyndns.org) Received: (from kettenis@localhost) by elgar.kettenis.dyndns.org (8.12.6p2/8.12.6/Submit) id h69Dc8u7023807; Wed, 9 Jul 2003 15:38:08 +0200 (CEST) Date: Wed, 09 Jul 2003 13:38:00 -0000 Message-Id: <200307091338.h69Dc8u7023807@elgar.kettenis.dyndns.org> From: Mark Kettenis To: mludvig@suse.cz CC: gdb-patches@sources.redhat.com In-reply-to: <3F0BF66A.3080203@suse.cz> (message from Michal Ludvig on Wed, 09 Jul 2003 13:03:06 +0200) Subject: Re: [RFA] Re: Analyzing AMD64 corefiles on i386 References: <3F0ABC85.1080700@suse.cz> <200307081445.h68EjBWJ000503@elgar.kettenis.dyndns.org> <3F0BF66A.3080203@suse.cz> X-SW-Source: 2003-07/txt/msg00168.txt.bz2 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. 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. Mark