Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: [RFA] gcore/linux-proc fix
Date: Wed, 24 Sep 2003 22:40:00 -0000	[thread overview]
Message-ID: <20030924224015.GA11928@nevyn.them.org> (raw)
In-Reply-To: <16241.52164.339042.549189@localhost.redhat.com>

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  <unknown>: 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.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2003-09-24 22:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-24 18:10 Elena Zannoni
2003-09-24 22:40 ` Daniel Jacobowitz [this message]
2003-09-25 19:45   ` Elena Zannoni
2003-09-29 21:18     ` Michael Snyder
2003-10-01 20:37       ` Elena Zannoni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030924224015.GA11928@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox