From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13541 invoked by alias); 21 Jan 2016 14:17:09 -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 13519 invoked by uid 89); 21 Jan 2016 14:17:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-qg0-f42.google.com Received: from mail-qg0-f42.google.com (HELO mail-qg0-f42.google.com) (209.85.192.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 21 Jan 2016 14:17:07 +0000 Received: by mail-qg0-f42.google.com with SMTP id 6so32272171qgy.1; Thu, 21 Jan 2016 06:17:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=81kpTCwrRpT/worbNQPdQPUesiy2qbMTOn9zYKMO9fY=; b=illpS0l3nPURc2Cjy0gNCFBKc/58Vv9G3nhUCP0EPvD6vwiqw6esdYSGKbwON/RqIX CP+TiAE6ALy+jz6WrG9D/SEt4AF1mKJ0wHSqLaeq6tn/E4Ibx25jLz7ka8HE00p+5oSN yituSsDMYG8UiH083eEbYC532UQAA65gDpoWNIPAPlGxX3klW5ycuYM7IMtvzRbpwt+F t/tfLvRdoA/m9mkrxmasJW12J1RlCaSWm1H1i3qi4Bw4rFuCXIVPyHTMAk/gfum3hv8W tmJmXrUg2QDow5tBu4uLCZXsVwFro/jXoalyD/ZeuKxN9aJdF/72zLgKxFAhtbUMrCIz lMtQ== X-Gm-Message-State: ALoCoQlCeL3T/TPoSmZ3nQADDcv+HMyNJGvVXbY3xHmcvRfCuuMm9SxiWpxG65saH+hCUND2A4mwf2tSfK/q6/MvVnMZdVBs6w== MIME-Version: 1.0 X-Received: by 10.140.246.6 with SMTP id r6mr54749230qhc.47.1453385824887; Thu, 21 Jan 2016 06:17:04 -0800 (PST) Received: by 10.55.215.6 with HTTP; Thu, 21 Jan 2016 06:17:04 -0800 (PST) In-Reply-To: <56A0E594.2080303@redhat.com> References: <20160121092855.GJ17028@bubble.grove.modra.org> <56A0CE51.1090709@redhat.com> <56A0D901.7010709@redhat.com> <56A0E594.2080303@redhat.com> Date: Thu, 21 Jan 2016 14:17:00 -0000 Message-ID: Subject: Re: Use elfcore_write_linux_prstatus in gdb From: "H.J. Lu" To: Pedro Alves Cc: Alan Modra , Binutils , GDB Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-01/txt/msg00519.txt.bz2 On Thu, Jan 21, 2016 at 6:05 AM, Pedro Alves wrote: > 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). > x32 has different core types (core layout) from m32 and m64. See bfd/hosts/x86-64linux.h for details. You need elfcore_write_linux_prstatusx32 or change elfcore_write_linux_prstatus32 to suport x32. -- H.J.