From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90135 invoked by alias); 21 Jan 2016 14:05:13 -0000 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 Received: (qmail 90101 invoked by uid 89); 21 Jan 2016 14:05:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=gap X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 21 Jan 2016 14:05:11 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id C714D445A7; Thu, 21 Jan 2016 14:05:10 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u0LE58QN031385; Thu, 21 Jan 2016 09:05:09 -0500 Message-ID: <56A0E594.2080303@redhat.com> Date: Thu, 21 Jan 2016 14:05:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: "H.J. Lu" CC: Alan Modra , Binutils , GDB Subject: Re: Use elfcore_write_linux_prstatus in gdb References: <20160121092855.GJ17028@bubble.grove.modra.org> <56A0CE51.1090709@redhat.com> <56A0D901.7010709@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-01/txt/msg00517.txt.bz2 On 01/21/2016 01:24 PM, H.J. Lu wrote: > On Thu, Jan 21, 2016 at 5:11 AM, Pedro Alves wrote: >> On 01/21/2016 12:25 PM, Pedro Alves wrote: >>> On 01/21/2016 09:28 AM, Alan Modra wrote: >>>> The gdb side. Nothing fancy here, and no support for targets that >>>> need gdbarch_elfcore_write_linux_prstatus, mips n32, sparc64 if >>>> writing any of pr_{u,s,cu,cs}time, and probably x86-64 x32. >>> >>> Thanks a lot for doing all this! I don't have spare cycles either to >>> drive this all the way to completion for all archs, I think we can still >>> move forward with it, by adding a stop-gap implementation those >>> archs, which just calls elfcore_write_prstatus. I'll send it along >>> in a bit. >> >> Like this. I've pushed this to the users/palves/core-prstatus-rework >> branch. I've tested on x86_64 with: >> >> make check RUNTESTFLAGS="--target_board unix/-m32" TESTS="*/*core*.exp" >> make check RUNTESTFLAGS="--target_board unix/-m64" TESTS="*/*core*.exp" > > It failed > > make check RUNTESTFLAGS="--target_board unix/-mx32" TESTS="*/*core*.exp" > > Please take a look at bfd/hosts/x86-64linux.h to see how to dump core > x86-64. I don't have x32 setup on my machine. AFAICS, elf_prstatusx32 is exactly like elf_prstatus32, except it takes a 64-bit regset. Given gdbarch_ptr_bit==32 on x32, and: else if (gdbarch_ptr_bit (data->gdbarch) == 64) data->note_data = elfcore_write_linux_prstatus64 (data->obfd, data->note_data, data->note_size, &prstatus); else data->note_data = elfcore_write_linux_prstatus32 (data->obfd, data->note_data, data->note_size, &prstatus); elfcore_write_linux_prstatus32 should be reached. Other than that, I have no idea (other than installing the stop gap on x32 too). Thanks, Pedro Alves