This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Backtrace from kernel to user space in coredump


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 <eager@eagerm.com> 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. ?The 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? ? How have other
> people handled traces back from kernel to user space?
>
>
> --
> Michael Eager ? ?eager@eagercon.com
> 1960 Park Blvd., Palo Alto, CA 94306 ?650-325-8077
>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]