WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

Re: [XenPPC] [PATCH] Print backtrace on BUG

hey Amos,
Please see how __warn() calls backtrace.
Also lets make this a full binding and call it __full_crash that way the backtrace will be labeled and useful since the first frames are dubious.
-JX
On Sep 20, 2006, at 11:41 PM, Amos Waterland wrote:

This makes Xen/PPC dump a backtrace when a BUG() is triggered.

Signed-off-by: Amos Waterland <apw@xxxxxxxxxx>

---

 config.h |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff -r 5418062d2da8 xen/include/asm-powerpc/powerpc64/config.h
--- a/xen/include/asm-powerpc/powerpc64/config.h
+++ b/xen/include/asm-powerpc/powerpc64/config.h
@@ -38,7 +38,15 @@

 #ifndef __ASSEMBLY__

-#define FORCE_CRASH() __asm__ __volatile__ ( "trap" )
+#define FORCE_CRASH () \ +do { \ + unsigned long sp, lr, pc, tp; \ + asm("mr %0, 1" : "=r" (sp)); \ + asm("mflr %0" : "=r" (lr)); \ + asm("mflr %0; bl 1f; 1: mflr %1; mtlr %0" : "=r" (tp), "=r" (pc)); \ + show_backtrace(sp, lr, pc); \ + __asm__ __volatile__ ( "trap" ); \
+} while ( 0 )

 #endif /* __ASSEMBLY__ */


_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel


_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel

<Prev in Thread] Current Thread [Next in Thread>