From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 26943 invoked from network); 12 Apr 1999 04:33:15 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 12 Apr 1999 04:33:15 -0000 Received: from moray.ucc.gu.uwa.edu.au (root@moray.ucc.gu.uwa.edu.au [130.95.13.9]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id AAA25159 for ; Mon, 12 Apr 1999 00:11:26 -0400 Received: from mermaid.ucc.gu.uwa.edu.au (dichro@mermaid.ucc.gu.uwa.edu.au [130.95.13.17]) by moray.ucc.gu.uwa.edu.au (8.8.8/8.8.8/Debian/GNU) with ESMTP id MAA04231 for ; Mon, 12 Apr 1999 12:11:23 +0800 Received: (from dichro@localhost) by mermaid.ucc.gu.uwa.edu.au (8.8.8/8.8.8/Debian/GNU) id MAA20457; Mon, 12 Apr 1999 12:11:22 +0800 Sender: dichro@ucc.gu.uwa.edu.au From: dichro-axp-list@rcpt.to (Mikolaj J. Habryn) To: axp-list@redhat.com Subject: Re: gdb and core files revisited References: <199904101808.LAA04983@helmholtz.salk.edu> Content-Type: text/plain; charset=us-ascii In-Reply-To: Jack Wathey's message of "Sat, 10 Apr 1999 11:08:10 -0700 (PDT)" User-Agent: Gnus/5.07008 (Pterodactyl Gnus v0.80) XEmacs/20.4 (Emerald) MIME-Version: 1.0 Date: 12 Apr 1999 12:11:21 +0800 Message-ID: >>>>> "JW" == Jack Wathey writes: JW> I've spent about 3 days digging through the internals of gdb, JW> trying to fix this, but it is just beyond my meager brain. JW> Has anyone, anywhere (possibly Debian types?), managed to get JW> gdb to work with a core file on an Alpha Linux machine running JW> a 2.2 kernel? If so, please tell me how. Yes, but this was quite a while ago. I didn't propagate the patch beyond the debian list since it was embarrassingly crude. It also didn't get much testing, since this was the heyday of the register_frame_info confusion. Anyhow - it think it might have used to work for me (maybe). m. PS: as an addendum, someone (rth?) posted a guide to solving this. I can't remember what it was, but I couldn't work out how to do it without making a lot more deltas than this. diff -Nru gdb-orig/bfd/elf.c gdb-4.17.19981224/bfd/elf.c --- gdb-orig/bfd/elf.c Mon Dec 7 08:33:14 1998 +++ gdb-4.17.19981224/bfd/elf.c Mon Jan 18 10:58:52 1999 @@ -4839,6 +4839,28 @@ */ #if defined (HAVE_PRSTATUS_T) +struct newtimeval { + long tv_sec; + long tv_usec; +}; + +struct newprstat { + struct elf_siginfo pr_info; /* Info associated with signal */ + short pr_cursig; /* Current signal */ + unsigned long pr_sigpend; /* Set of pending signals */ + unsigned long pr_sighold; /* Set of held signals */ + pid_t pr_pid; + pid_t pr_ppid; + pid_t pr_pgrp; + pid_t pr_sid; + struct newtimeval pr_utime; /* User time */ + struct newtimeval pr_stime; /* System time */ + struct newtimeval pr_cutime; /* Cumulative user time */ + struct newtimeval pr_cstime; /* Cumulative system time */ + elf_gregset_t pr_reg; /* GP registers */ + int pr_fpvalid; /* True if math co-processor being used. */ +}; + static boolean elfcore_grok_prstatus (abfd, note) bfd* abfd; @@ -4850,9 +4872,35 @@ asection* sect; if (note->descsz != sizeof (prstat)) +#ifdef alpha + if(note->descsz == sizeof(struct newprstat)) { + prstat.pr_info = ((struct newprstat *)note->descdata)->pr_info; + prstat.pr_cursig = ((struct newprstat *)note->descdata)->pr_cursig; + prstat.pr_sigpend = ((struct newprstat *)note->descdata)->pr_sigpend; + prstat.pr_sighold = ((struct newprstat *)note->descdata)->pr_sighold; + prstat.pr_pid = ((struct newprstat *)note->descdata)->pr_pid; + prstat.pr_ppid = ((struct newprstat *)note->descdata)->pr_ppid; + prstat.pr_pgrp = ((struct newprstat *)note->descdata)->pr_pgrp; + prstat.pr_sid = ((struct newprstat *)note->descdata)->pr_sid; + prstat.pr_utime.tv_sec = ((struct newprstat *)note->descdata)->pr_utime.tv_sec; + prstat.pr_utime.tv_usec = ((struct newprstat *)note->descdata)->pr_utime.tv_usec; + prstat.pr_stime.tv_sec = ((struct newprstat *)note->descdata)->pr_stime.tv_sec; + prstat.pr_stime.tv_usec = ((struct newprstat *)note->descdata)->pr_stime.tv_usec; + prstat.pr_cutime.tv_sec = ((struct newprstat *)note->descdata)->pr_cutime.tv_sec; + prstat.pr_cutime.tv_usec = ((struct newprstat *)note->descdata)->pr_cutime.tv_usec; + prstat.pr_cstime.tv_sec = ((struct newprstat *)note->descdata)->pr_cstime.tv_sec; + prstat.pr_cstime.tv_usec = ((struct newprstat *)note->descdata)->pr_cstime.tv_usec; + memcpy(&prstat.pr_reg, &((struct newprstat *)note->descdata)->pr_reg, + sizeof(elf_gregset_t)); + prstat.pr_fpvalid = ((struct newprstat *)note->descdata)->pr_fpvalid; + } else { + return true; + } +#else return true; memcpy (&prstat, note->descdata, sizeof (prstat)); +#endif elf_tdata (abfd)->core_signal = prstat.pr_cursig; elf_tdata (abfd)->core_pid = prstat.pr_pid;