This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Put a NT_PSTATUS note on solaris cores.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]