From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 28650 invoked from network); 21 Dec 1999 23:48:34 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 21 Dec 1999 23:48:34 -0000 Received: from zmamail02.zma.compaq.com (zmamail02.zma.compaq.com [161.114.64.102]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id SAA06109 for ; Tue, 21 Dec 1999 18:48:34 -0500 Received: by zmamail02.zma.compaq.com (Postfix, from userid 12345) id 89BF220C; Tue, 21 Dec 1999 18:47:58 -0500 (EST) Received: from cxo3ns.cxo.dec.com (cxo3ns.cxo.dec.com [16.63.0.10]) by zmamail02.zma.compaq.com (Postfix) with SMTP id 7DCD72BF; Tue, 21 Dec 1999 18:47:57 -0500 (EST) Received: from brownfur.cxo.dec.com by cxo3ns.cxo.dec.com; (5.65v4.0/1.1.8.2/11Apr96-1001AM) id AA07051; Tue, 21 Dec 1999 16:47:56 -0700 Received: from dhcp192-89.cxo.dec.com by brownfur.cxo.dec.com (5.65v4.0/1.1.10.5/17Feb98-0753AM) id AA04529; Tue, 21 Dec 1999 16:47:55 -0700 Received: by compaq.com (sSMTP sendmail emulation); Thu, 23 Dec 1999 16:46:17 -0700 Message-Id: X-Mailer: XFMail 1.4.4 on Linux X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Mime-Version: 1.0 In-Reply-To: Date: Thu, 23 Dec 1999 16:46:16 -0700 (MST) Reply-To: Brian Hall Sender: brianw.hall@compaq.com From: Brian Hall To: Matt Robinson Subject: new problem: can't see vmdump.h? Cc: comp.os.linux.alpha@list.deja.com, lkcd@oss.sgi.com, axp-list@redhat.com OK, I've got the following code in __dump_execute: __dump_execute(struct file *dump_file, char *panic_str, struct pt_regs *regs, int dump_level, int dump_compress_pages) { dump_here: ( some code skipped here) /* For Alpha, save the Program Counter and Stack Pointer */ dump_header.dh_esp = __asm__("$30"); /* get stack pointer */ dump_header.dh_eip = &&dump_here; /* get Program Counter */ Sound OK? I removed the cmd directory temporarily from the top level Makefile so I could do a test build (lots of work todo there!). Had to fix a type in sd.c, but the compile died completely when it reached arch/alpha/kernel/vmdump.c, apparently because it couldn't see vmdump.h. Huh? File does exist as requested in include/linux; adding an include line with the explicit path to it didn't help. Any idea why this fails to see the include? /usr/src/linux is actually symlinked to a mounted NFS share that holds the kernel source; doesn't seem like that would be the problem since the rest of the kernel was building fine. /usr/include/linux points to ../src/linux/include/linux/. On 21-Dec-1999 Matt Robinson wrote: > On Thu, 23 Dec 1999, Brian Hall wrote: >|>Well, it's not clear to me how to get the PC and RA of interest off the >|>stack >|>when we are in the vmdump functions. We could retreive the RA from register >|>26 >|>in the panic() function itself, and pass that to the dump_execute function. >|>Then the dump code could at least tell where panic was called from. Is this >|>sufficient, or at least a start? > > In the __dump_execute() function, just save the PC into the right > registers, and that'll be enough. You don't have to fill the pt_regs > structure. > > The big keys are the stack pointer and the PC for that process within > the __dump_execute() function. Save the stack pointer into > dump_header.dh_esp, and the PC into dump_header.dh_eip. That's all > 'lcrash' should need in order to figure out the stack trace of the > failing process (for now). Having the RA is nice, but not entirely > necessary. > > I should have named dh_esp and dh_eip into something like dh_sp and > dh_pc, for simplicity's sake. Next revision ... > > --Matt > >|>On 18-Dec-1999 Brian Hall wrote: >|>> Okay, after some research, I think I figured out how to get at the needed >|>> Alpha registers: >|>> >|>> register unsigned long fptr __asm__("$15"); /* get frame pointer? */ >|>> register unsigned long sptr __asm__("$30"); /* get stack pointer? */ >|>> >|>> Now, my understanding of the problem is that I need to go back two frames >|>> on >|>> the stack to get the PC of interest, and three for the RA of interest. How >|>> do >|>> I >|>> do this? I haven't had much luck yet trying to figure out how to navigate >|>> the >|>> kernel stack. I see the pt_regs structure, but I'm not exactly sure how to >|>> figure the frame size, since that can vary with each frame. >|>> >|>> On 13-Dec-1999 Matt Robinson wrote: >|>>> The problem is from panic(), you don't have the registers, so you >|>>> need to grab them. That way the 'lcrash' code has a point to start >|>>> with as far as the failing process is concerned. Hence the "if (regs)" >|>>> stuff. >|> >|>-- >|>Brian Hall >|>Linux Consultant -- Brian Hall Linux Consultant