From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10936 invoked by alias); 14 Jun 2010 07:23:39 -0000 Received: (qmail 10918 invoked by uid 22791); 14 Jun 2010 07:23:37 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-pv0-f169.google.com (HELO mail-pv0-f169.google.com) (74.125.83.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 14 Jun 2010 07:23:32 +0000 Received: by pva18 with SMTP id 18so5912176pva.0 for ; Mon, 14 Jun 2010 00:23:31 -0700 (PDT) Received: by 10.142.56.17 with SMTP id e17mr3765073wfa.12.1276500211118; Mon, 14 Jun 2010 00:23:31 -0700 (PDT) MIME-Version: 1.0 Received: by 10.142.57.15 with HTTP; Mon, 14 Jun 2010 00:23:11 -0700 (PDT) In-Reply-To: <4C138642.2080202@eagerm.com> References: <4C138642.2080202@eagerm.com> From: Hui Zhu Date: Mon, 14 Jun 2010 07:23:00 -0000 Message-ID: Subject: Re: Backtrace from kernel to user space in coredump To: Michael Eager Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-06/txt/msg00048.txt.bz2 http://sourceware.org/ml/gdb-patches/2010-02/msg00533.html I make this patch for other thing. It can save the memory and reg operation command's value and send it to GDB as the inferior's value. Then you can do backtrace. I think maybe you can put the reg and sp memory 's value to GDB. Then you can do backtrace. Thanks, Hui On Sat, Jun 12, 2010 at 21:06, Michael Eager wrote: > Hi -- > > I want to be able to generate a backtrace in a > core dump from a uClinux kernel routine (say, > do_trap() or do_page_fault()) to the user-space > routine which caused the trap. =A0The kernel function > is called with a pt_regs struct which contains the > user regs. > > One way I thought to do this is to set the $PC and > $SP to the value saved in pt_regs and do a "bt". > If I try to set the $PC, gdb complains that there > is no process, since there are no routines to modify > a core file. > > I can modify gdb to save the registers returned from > reading the core file and add routines allow modifying > these saved register values. > > Are there better ways to do this? =A0 How have other > people handled traces back from kernel to user space? > > > -- > Michael Eager =A0 =A0eager@eagercon.com > 1960 Park Blvd., Palo Alto, CA 94306 =A0650-325-8077 >