Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: Put a NT_PSTATUS note on solaris cores.
Date: Fri, 09 Oct 2009 01:36:00 -0000	[thread overview]
Message-ID: <200910090236.10584.pedro@codesourcery.com> (raw)

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, I see that pstatus_t is assumed to be defined when
NEW_PROC_API is defined, so I think this is safe to not break builds.
NEW_PROC_API is also always defined on unixware hosts.  I'm not
caring for older solaris not using the new proc api.

That bit of ifdefed code wasn't building without the stop_signal
tweak, meaning that the unixware build has been broken
for months and nobody complained.

Checked in.

-- 
Pedro Alves

2009-10-09  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 |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

Index: src/gdb/procfs.c
===================================================================
--- src.orig/gdb/procfs.c	2009-08-08 14:38:01.000000000 +0100
+++ src/gdb/procfs.c	2009-10-09 02:24:06.000000000 +0100
@@ -6126,6 +6126,7 @@ procfs_make_note_section (bfd *obfd, int
   struct procfs_corefile_thread_data thread_args;
   gdb_byte *auxv;
   int auxv_len;
+  enum target_signal stop_signal;
 
   if (get_exec_file (0))
     {
@@ -6150,7 +6151,9 @@ procfs_make_note_section (bfd *obfd, int
 					       fname,
 					       psargs);
 
-#ifdef UNIXWARE
+  stop_signal = find_stop_signal ();
+
+#ifdef NEW_PROC_API
   fill_gregset (get_current_regcache (), &gregs, -1);
   note_data = elfcore_write_pstatus (obfd, note_data, note_size,
 				     PIDGET (inferior_ptid),
@@ -6160,7 +6163,7 @@ procfs_make_note_section (bfd *obfd, int
   thread_args.obfd = obfd;
   thread_args.note_data = note_data;
   thread_args.note_size = note_size;
-  thread_args.stop_signal = find_stop_signal ();
+  thread_args.stop_signal = stop_signal;
   proc_iterate_over_threads (pi, procfs_corefile_thread_callback, &thread_args);
 
   /* There should be always at least one thread.  */


             reply	other threads:[~2009-10-09  1:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-09  1:36 Pedro Alves [this message]
2009-10-11 21:21 ` Paul Pluzhnikov
2009-10-11 22:10   ` Pedro Alves
2009-10-11 22:35     ` Paul Pluzhnikov
2009-10-11 22:40       ` Pedro Alves
2009-10-11 23:21         ` Paul Pluzhnikov
2009-10-31 16:34           ` Paul Pluzhnikov
2009-10-31 21:00             ` Pedro Alves
2009-10-31 23:26               ` Paul Pluzhnikov
2009-10-11 22:53     ` 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=200910090236.10584.pedro@codesourcery.com \
    --to=pedro@codesourcery.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