Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Put a NT_PSTATUS note on solaris cores.
@ 2009-10-09  1:36 Pedro Alves
  2009-10-11 21:21 ` Paul Pluzhnikov
  0 siblings, 1 reply; 10+ messages in thread
From: Pedro Alves @ 2009-10-09  1:36 UTC (permalink / raw)
  To: gdb-patches

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.  */


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2009-10-31 23:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-09  1:36 Put a NT_PSTATUS note on solaris cores Pedro Alves
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox