Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: dichro-axp-list@rcpt.to (Mikolaj J. Habryn)
To: axp-list@redhat.com
Subject: Re: gdb and core files revisited
Date: 12 Apr 1999 12:11:21 +0800	[thread overview]
Message-ID: <s2vd81aqxzq.fsf@mermaid.ucc.gu.uwa.edu.au> (raw)
In-Reply-To: Jack Wathey's message of "Sat, 10 Apr 1999 11:08:10 -0700 (PDT)"

>>>>> "JW" == Jack Wathey <wathey@salk.edu> 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;


  reply	other threads:[~1999-04-12  4:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-04-10 18:08 gdb and core files revisited Jack Wathey
1999-04-12  4:11 ` Mikolaj J. Habryn [this message]
1999-04-14  8:01   ` Richard Henderson
1999-04-14  8:47     ` Mikolaj J. Habryn
read-only archive

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