Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/2] Put a NT_PSTATUS note on solaris cores.
Date: Mon, 10 Dec 2012 18:02:00 -0000	[thread overview]
Message-ID: <20121210180216.3932.48633.stgit@brno.lan> (raw)
In-Reply-To: <50C6115C.4090509@redhat.com>

This is basically the same patch I once posted at:

http://sourceware.org/ml/gdb-patches/2009-10/msg00188.html

Rationale:

This patch makes is to that cores generated with gdb's gcore on
solaris also get an NT_PSTATUS note.  It is from this note that gdb
can extract the original pid of the process from the core.  From
higher up on procfs.c, we see that pstatus_t is assumed to be defined
when NEW_PROC_API is defined, so this should be safe to not break
builds on supported hosts.  NEW_PROC_API is also always defined on
unixware hosts.  Older Solaris not using the the new proc api are
unaffected.


I had applied the patch back in 2009, and then shortly afterwards
backed it out, because it broke Solaris builds.  A patch to bfd this
depended on was missing:

  http://sourceware.org/ml/gdb-patches/2009-10/msg00214.html

The bfd patch when in 2010-01-04, but I never got back to pushing the
GDB bit in.

I no longer have easy access to Solaris hosts to test on though...
Anyone interested in trying this, and seeing it in?  The user visible
change is just that GDB will know the real PID the process that dumped
core had (visible when you load the core, and in "info inferiors").

The next patch removes all #ifdef UNIXWARE code, and that would remove
this pstatus note code too.

2012-12-10  Pedro Alves  <pedro@codesourcery.com>

	gdb/
	* procfs.c (procfs_make_note_section): Always output a NT_PSTATUS
	note when NEW_PROC_API is defined.
---
 gdb/procfs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/procfs.c b/gdb/procfs.c
index 82c7cd0..da5e158 100644
--- a/gdb/procfs.c
+++ b/gdb/procfs.c
@@ -5544,7 +5544,7 @@ procfs_make_note_section (bfd *obfd, int *note_size)
 
   stop_signal = find_stop_signal ();
 
-#ifdef UNIXWARE
+#ifdef NEW_PROC_API
   fill_gregset (get_current_regcache (), &gregs, -1);
   note_data = elfcore_write_pstatus (obfd, note_data, note_size,
 				     PIDGET (inferior_ptid),


  reply	other threads:[~2012-12-10 18:02 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-06 17:37 [PATCH] solib-svr4.c: Remove old SCO-related code Pedro Alves
2012-12-10 16:44 ` Pedro Alves
2012-12-10 18:02   ` Pedro Alves [this message]
2012-12-11  3:04     ` [PATCH 1/2] Put a NT_PSTATUS note on solaris cores Joel Brobecker
2012-12-11 12:22       ` Pedro Alves
2012-12-11 15:12         ` Joel Brobecker
2012-12-11 15:16           ` Mark Kettenis
2012-12-11 16:45             ` Pedro Alves
2012-12-10 18:04   ` [PATCH 2/2] Remove all traces of Unixware Pedro Alves
2012-12-10 19:24     ` Tom Tromey
2012-12-11  2:57     ` Joel Brobecker
2012-12-11 11:37       ` Pedro Alves
2012-12-11 12:46         ` Eli Zaretskii
2012-12-11  4:20     ` Yao Qi
2012-12-11 10:59       ` Pedro Alves

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=20121210180216.3932.48633.stgit@brno.lan \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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