summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerry Jelinek <jerry.jelinek@joyent.com>2014-11-12 19:42:16 +0000
committerJerry Jelinek <jerry.jelinek@joyent.com>2014-11-12 19:42:16 +0000
commitc55285a59af2a3fba41520d3ee321c74e36dbcec (patch)
tree41dd3bf0a9922669711cb912dbcd46d248093de6
parentb64a843759c805fdd05d57960c11c19ae24f0701 (diff)
downloadillumos-joyent-c55285a59af2a3fba41520d3ee321c74e36dbcec.tar.gz
OS-3540 lx core dumps show 0 value for all regs
-rw-r--r--usr/src/lib/libproc/common/Pcore.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/usr/src/lib/libproc/common/Pcore.c b/usr/src/lib/libproc/common/Pcore.c
index 05e5ce2e08..008f6d7172 100644
--- a/usr/src/lib/libproc/common/Pcore.c
+++ b/usr/src/lib/libproc/common/Pcore.c
@@ -2201,6 +2201,7 @@ Pfgrab_core(int core_fd, const char *aout_path, int *perr)
struct stat64 stbuf;
void *phbuf, *php;
size_t nbytes;
+ boolean_t from_linux = B_FALSE;
elf_file_t aout;
elf_file_t core;
@@ -2444,6 +2445,13 @@ Pfgrab_core(int core_fd, const char *aout_path, int *perr)
*perr = G_NOTE;
goto err;
}
+ /*
+ * The presence of either of these notes indicates that
+ * the dump was generated on Linux.
+ */
+ if (nhdr.n_type == NT_PRSTATUS ||
+ nhdr.n_type == NT_PRPSINFO)
+ from_linux = B_TRUE;
} else {
(void) note_notsup(P, nhdr.n_descsz);
}
@@ -2465,7 +2473,7 @@ Pfgrab_core(int core_fd, const char *aout_path, int *perr)
nleft -= sizeof (nhdr) + namesz + descsz;
}
- if (core_info->core_osabi == ELFOSABI_NONE) {
+ if (from_linux) {
size_t tcount, pid;
lwp_info_t *lwp;