From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31043 invoked by alias); 8 Apr 2006 20:34:42 -0000 Received: (qmail 31032 invoked by uid 22791); 8 Apr 2006 20:34:41 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sat, 08 Apr 2006 20:34:40 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FSK8j-0004vt-SF; Sat, 08 Apr 2006 16:34:37 -0400 Date: Sat, 08 Apr 2006 20:34:00 -0000 From: Daniel Jacobowitz To: "David S. Miller" Cc: gdb-patches@sources.redhat.com, mark.kettenis@xs4all.nl Subject: Re: [PATCH]: Use core regset when possible in linux-nat.c Message-ID: <20060408203437.GC18707@nevyn.them.org> Mail-Followup-To: "David S. Miller" , gdb-patches@sources.redhat.com, mark.kettenis@xs4all.nl References: <20060406.150330.76592441.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060406.150330.76592441.davem@davemloft.net> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00098.txt.bz2 On Thu, Apr 06, 2006 at 03:03:30PM -0700, David S. Miller wrote: > *1: The test in corefile.exp to look at the mmap() area pointed > to by buf2 fails due to a Linux kernel bug, it doesn't dump > mmap() areas which have not been written to into the core > file so gdb can't look at it. I've posted a patch to linux-kernel > already suggesting to take away that check in the ELF core dumper. Or, we could just change the test. I don't know... > 2006-04-06 David S. Miller > > * linux-nat.c (linux_nat_do_thread_registers): Use the > regset_from_core_section infrastructure if the target > supports it. > * Makefile.in: Update dependencies. Almost. I know I suggested changing the fallback case from your original suggestion, but this isn't quite what I meant: > - fill_fpregset (&fpregs, -1); > + if (core_regset_p) > + { > + regset = gdbarch_regset_from_core_section (gdbarch, ".reg2", > + sizeof (fpregs)); > + regset->collect_regset (regset, current_regcache, -1, > + &fpregs, sizeof (fpregs)); > + } > + else > + fill_fpregset (&fpregs, -1); > note_data = (char *) elfcore_write_prfpreg (obfd, > note_data, > note_size, > &fpregs, sizeof (fpregs)); A target which only defines .reg and not .reg2 will crash here. We'd still have to check for non-NULL; I just think that if the target supports regset_from_core_section, and still returns NULL, that that's a pretty good hint we have nothing to write. The other thing that bugs me about this interface may be harder to fix - we're still assuming the two are the same, more or less, because the regset type is required here and we use its sizeof. A problem for another day? -- Daniel Jacobowitz CodeSourcery