From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20645 invoked by alias); 9 Nov 2011 16:05:42 -0000 Received: (qmail 20629 invoked by uid 22791); 9 Nov 2011 16:05:39 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 09 Nov 2011 16:05:17 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1ROAeK-0002eg-LF from pedro_alves@mentor.com ; Wed, 09 Nov 2011 08:05:16 -0800 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Wed, 9 Nov 2011 16:05:14 +0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [rfc][2/3] Remote core file generation: register notes Date: Wed, 09 Nov 2011 16:05:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-12-generic; KDE/4.7.2; x86_64; ; ) Cc: "Ulrich Weigand" References: <201110211856.p9LIud0r012859@d06av02.portsmouth.uk.ibm.com> In-Reply-To: <201110211856.p9LIud0r012859@d06av02.portsmouth.uk.ibm.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201111091605.12123.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-11/txt/msg00231.txt.bz2 On Friday 21 October 2011 19:56:39, Ulrich Weigand wrote: > write_gcore_file today uses a target hook target_make_corefile_notes in > order to generate the core file note section. Having this as a target > hook is really inappropriate when we want to support remote core file > generation; it should really be a gdbarch callback instead. > > Note that this is the same transition we had with *reading* core files; > that was intially supported on native targets only, but is now usually > supported for remote targets via gdbarch hooks. > > To avoid having to complete that transition in one go across all > targets, the patch for now adds a gdbarch_make_corefile_notes routine > in addition to target_make_corefile_notes. For architectures that > do not yet provide a gdbarch_make_corefile_notes routine, common > code will fall back on the target hook. > > The patch implements this routine for all Linux targets in linux-tdep.c, > moving code from linux-nat.c there. Note that not even all Linux targets > can be converted at this point, only those that already implement the > gdbarch_core_regset_sections hook -- if we don't have that, we do not > know the sizes of core file register sections, and have to fall back > on using regset data types from native system headers. > > Therefore, I'm keeping a fall-back native-only implementation in > linux-nat.c for now; to avoid duplication this uses a helper routine > in linux-tdep.c for everything except the core register sets. > > Note that the previous BFD patch is a prerequiste; otherwise, we might > get link failures due to unresolved symbols for cross GDB builds. This looks very good to me. -- Pedro Alves