linux-mips
[Top] [All Lists]

how to print stack trace in signal handler

To: <linux-mips@linux-mips.org>
Subject: how to print stack trace in signal handler
From: "Rockson Li (zhengyli)" <zhengyli@cisco.com>
Date: Tue, 8 Jul 2008 17:21:27 +0800
Authentication-results: hkg-dkim-2; header.From=zhengyli@cisco.com; dkim=pass ( sig from cisco.com/hkgdkim2001 verified; );
Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; l=4826; t=1215508870; x=1216372870; c=relaxed/simple; s=hkgdkim2001; h=Content-Type:From:Subject:Content-Transfer-Encoding:MIME-Version; d=cisco.com; i=zhengyli@cisco.com; z=From:=20=22Rockson=20Li=20(zhengyli)=22=20<zhengyli@cisco. com> |Subject:=20how=20to=20print=20stack=20trace=20in=20signal= 20handler |Sender:=20; bh=nyaKDYidV/Ief5xiCacNELHbtmRbMy/Svb+xsF44p1o=; b=Barj1WOnUH9CcenPGEjyH4osWSEF9uxU4zVEuoxGrJOj/Gjyffm4lC/NE/ y5hakRqWvjKUAc14vQV4/vz0vodyXov8OlyJkh/C62pJWK1WzCGdPsL+FBeM ucx79o7z2Gkog4UEVn1FFvZCWVV2c30UeRdrztClcBMz27r7g2tTg=;
Original-recipient: rfc822;linux-mips@linux-mips.org
Sender: linux-mips-bounce@linux-mips.org
Thread-index: Acjg2//7N2WRMUCxTzmVrQyGKGOWCQ==
Thread-topic: how to print stack trace in signal handler
Hi Gurus,
 
I want to print the stack trace in exception signal handler, do you guys know any reliable way to do it?
 
My Dev Env,
Gcc: MontaVista 3.3.1
Linux Kernel: 2.4.18
Glibc: 2.3.2
 
I tired,
1) backtrace, it just print nothing.
2) try to use sa_sigaction, but when I get uc_mcontext.gregs from the third parameter (cast to ucontext_t*),
    there is no stack pointer register??
 
do not know why.
 
Many thanks
 
-Rockson
 
Registers dumped in signal handler:
Reg 0: 0
Reg 1: 5f13
Reg 2: 0
Reg 3: 47269c
Reg 4: 0
Reg 5: 0
Reg 6: 0
Reg 7: 7fff7918
Reg 8: 0
Reg 9: 0
Reg 10: 0
Reg 11: 8
Reg 12: 0
Reg 13: b
Reg 14: 0
Reg 15: 7fff78f8
Reg 16: 0
Reg 17: 0
Reg 18: 0
Reg 19: 0
Reg 20: 0
Reg 21: 5f00
Reg 22: 0
Reg 23: b
Reg 24: 0
Reg 25: 0
Reg 26: 0
Reg 27: 0
Reg 28: 0
Reg 29: 0
Reg 30: 0
Reg 31: 0
Reg 32: 0
Reg 33: b
Reg 34: 0
Reg 35: 0
Reg 36: 0
 
 

<Prev in Thread] Current Thread [Next in Thread>
  • how to print stack trace in signal handler, Rockson Li (zhengyli) <=