In ups/ao_elfcore.c, replace get_note_info with the following. This is required to debug Solaris 2.5 cores under 2.6: -------------------------------------------------------------------------------- #ifdef AO_USE_PROCFS static bool get_note_info(alloc_pool_t *ap, const char *path, int fd, Elf32_Phdr *note_ph, int *p_signo, char **p_cmdname, const char **p_cmdline, prgreg_t **p_regs, prfpregset_t **p_p_fpregs) #else static bool get_note_info(alloc_pool_t *ap, const char *path, int fd, Elf32_Phdr *note_ph, int *p_signo, char **p_cmdname, const char **p_cmdline) #endif { /* These values come from the the Solaris 2 core(4) man page. RGA for Solaris 2.6, NT_PSINFO = 13 in elf.h, so prepend UPS_. The file now has : NT_PRSTATUS 1 NT_PRFPREG 2 NT_PRPSINFO 3 */ enum { UPS_NT_STATUS = 1, UPS_NT_FPREGSET = 2, UPS_NT_PSINFO = 3, UPS_NT_TASKSTRUCT = 4, /* RGA added */ UPS_NT_PLATFORM = 5, /* RCB added */ UPS_NT_AUXVEC = 6, /* RCB added */ UPS_NT_GWINDOWS = 7, /* RGA added */ UPS_NT_PSTATUS = 10, /* RGA added */ UPS_NT_PSINFO2 = 13, /* RGA added */ UPS_NT_PRCRED = 14, /* RGA added */ UPS_NT_UTSNAME = 15, /* RGA added */ UPS_NT_LWPSTATUS = 16, /* RGA added */ UPS_NT_LWPSINFO = 17 /* RGA added */ }; static const char what[] = "ELF core file"; char *buf, *cmdname; const char *cmdline; int signo; size_t pos; #ifdef AO_USE_PROCFS prfpregset_t *fpregs; prgreg_t *regs; #endif if (note_ph == NULL) { errf("No PT_NOTE section in ELF core file %s", path); return FALSE; } buf = e_malloc(note_ph->p_filesz); if (!read_chunk(path, "Elf executable", fd, "note section", (off_t)note_ph->p_offset, buf, note_ph->p_filesz)) { return FALSE; } #ifdef AO_USE_PROCFS regs = NULL; fpregs = NULL; #endif cmdname = NULL; cmdline = NULL; pos = 0; while (pos < note_ph->p_filesz) { int *ip; const char *name, *desc; int namesz, descsz, type; ip = (int *)&buf[pos]; namesz = ip[0]; descsz = ip[1]; type = ip[2]; name = (char *)&ip[3]; desc = name + ((namesz + 3) / 4) * 4; switch (type) { #ifdef AO_USE_PROCFS case UPS_NT_STATUS: case UPS_NT_PSTATUS: get_prstatus_info(ap, (prstatus_t *)desc, &signo, ®s); break; case UPS_NT_FPREGSET: fpregs = e_malloc(sizeof(prfpregset_t)); memcpy(fpregs, desc, sizeof(prfpregset_t)); break; #endif case UPS_NT_PSINFO: case UPS_NT_PSINFO2: get_psinfo_info(ap, (prpsinfo_t *)desc, &cmdname, &cmdline); break; case UPS_NT_GWINDOWS: case UPS_NT_TASKSTRUCT: case UPS_NT_PLATFORM: case UPS_NT_AUXVEC: case UPS_NT_PRCRED: case UPS_NT_UTSNAME: case UPS_NT_LWPSTATUS: case UPS_NT_LWPSINFO: break; default: errf("Unknown PT_NOTE type %d in ELF core file %s " "- ignored", type, path); break; } pos = (desc - buf) + ((descsz + 3) / 4) * 4; } free(buf); if (cmdname == NULL) { errf("No prpsinfo_t item in note section of %s %s", what, path); return FALSE; } #ifdef AO_USE_PROCFS if (regs == NULL) { errf("No prstatus_t item in note section of %s %s", what, path); free(cmdname); return FALSE; } #endif *p_cmdname = cmdname; #ifdef AO_USE_PROCFS *p_regs = regs; *p_p_fpregs = fpregs; #endif *p_signo = signo; *p_cmdline = cmdline; return TRUE; }