From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9278 invoked by alias); 25 Sep 2003 19:45:54 -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 9263 invoked from network); 25 Sep 2003 19:45:54 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 25 Sep 2003 19:45:54 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id h8PJjr104638 for ; Thu, 25 Sep 2003 15:45:53 -0400 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id h8PJjrc22774; Thu, 25 Sep 2003 15:45:53 -0400 Received: from localhost.redhat.com (devserv.devel.redhat.com [172.16.58.1]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id h8PJjrTX002663; Thu, 25 Sep 2003 15:45:53 -0400 Received: by localhost.redhat.com (Postfix, from userid 469) id 5B3852CCA4; Thu, 25 Sep 2003 15:55:44 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <16243.18496.210237.478143@localhost.redhat.com> Date: Thu, 25 Sep 2003 19:45:00 -0000 To: Daniel Jacobowitz Cc: msnyder@redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFA] gcore/linux-proc fix In-Reply-To: <20030924224015.GA11928@nevyn.them.org> References: <16241.52164.339042.549189@localhost.redhat.com> <20030924224015.GA11928@nevyn.them.org> X-SW-Source: 2003-09/txt/msg00573.txt.bz2 Daniel Jacobowitz writes: > On Wed, Sep 24, 2003 at 12:52:20PM -0400, Elena Zannoni wrote: > > > > This patch fixes some problems with the gcore command on single > > threaded programs. Before the patch, the core file did not report > > anywhere the PID of the process: > > > > > > CORE 144 PRSTATUS > > SIGINFO: signo: 0, code = 0, errno = 0 > > signal: 0, pending: 00000000, holding: 00000000 > > pid: 0, ppid = 0, pgrp = 0, sid = 0 > > ^^^^^^^^^ > > > > > > utime: 0.000000s, stime: 0.000000s > > cutime: 0.000000s, cstime: 0.000000s > > eax: fffffffc ebx: bfffc4a4 ecx: bfffc4a4 edx: b75d79f8 > > esi: bfffc5bc edi: bfffc53c ebp: bfffc648 esp: bfffc484 > > eip: b75ebc02 eflags: 00000246, original eax: 000000a2 > > cs: 0023 ds: 002b es: 002b fs: 0000 gs: 0033 ss: 002b > > > > > > > > > > after the patch: > > > > > > CORE 144 PRSTATUS > > SIGINFO: signo: 0, code = 0, errno = 0 > > signal: 0, pending: 00000000, holding: 00000000 > > pid: 5846, ppid = 0, pgrp = 0, sid = 0 > > ^^^^^^^^^^^^ > > > > utime: 0.000000s, stime: 0.000000s > > cutime: 0.000000s, cstime: 0.000000s > > eax: fffffffc ebx: bffff674 ecx: bffff674 edx: b75d79f8 > > esi: bffff78c edi: bffff70c ebp: bffff818 esp: bffff654 > > eip: b75ebc02 eflags: 00000246, original eax: 000000a2 > > cs: 0023 ds: 002b es: 002b fs: 0000 gs: 0033 ss: 002b > > > > CORE 108 FPREGSET > > LINUX 512 : 1189489535 > > > > > > > > Note also that if the function to write the note section is called via > > the iterator for multi-threaded programs > > (i.e. linux_corefile_thread_callback), > > registers_changed()/target_fetch_registers() are called, but if > > invoked directly for the single-threaded case, > > registers_changed()/target_fetch_registers() are not called. > > So I added a wrapper to do that. > > > > It all works fine with multi-threaded apps. > > Looks good to me. I've been using a similar hack to call > target_fetch_registers, too. Cool, I'll wait to see if Michael has any comments. elena > > -- > Daniel Jacobowitz > MontaVista Software Debian GNU/Linux Developer