debuggers.hg

changeset 22820:96441daf4a5b

xen: stringify assertion condition for printing sooner.

So that:
(XEN) Assertion '!(((*({ unsigned long __ptr; __asm__ ("" :
"=r"(__ptr) : "0"(&per_cpu____preempt_count));
(typeof(&per_cpu____preempt_count)) (__ptr +
(get_cpu_info()->per_cpu_offset)); }))) ||
((irq_stat[(((get_cpu_info()->processor_id)1...
becomes:
(XEN) Assertion '"!in_atomic()"' failed at softirq.c:61

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
author Keir Fraser <keir@xen.org>
date Tue Jan 18 09:01:57 2011 +0000 (2011-01-18)
parents 02c0af2bf280
children e4688c57c230
files xen/include/asm-x86/bug.h xen/include/xen/lib.h
line diff
     1.1 --- a/xen/include/asm-x86/bug.h	Mon Jan 17 18:05:52 2011 +0000
     1.2 +++ b/xen/include/asm-x86/bug.h	Tue Jan 18 09:01:57 2011 +0000
     1.3 @@ -40,7 +40,7 @@ struct bug_frame {
     1.4      asm volatile (                                 \
     1.5          "ud2 ; ret %0" BUG_STR(1) BUG_STR(2)       \
     1.6          : : "i" (BUGFRAME_assert | (__LINE__<<2)), \
     1.7 -            "i" (__FILE__), "i" (#p) )
     1.8 +            "i" (__FILE__), "i" (p) )
     1.9  
    1.10  
    1.11  #endif /* __X86_BUG_H__ */
     2.1 --- a/xen/include/xen/lib.h	Mon Jan 17 18:05:52 2011 +0000
     2.2 +++ b/xen/include/xen/lib.h	Tue Jan 18 09:01:57 2011 +0000
     2.3 @@ -27,7 +27,7 @@ void __warn(char *file, int line);
     2.4  #ifndef assert_failed
     2.5  #define assert_failed(p)                                        \
     2.6  do {                                                            \
     2.7 -    printk("Assertion '%s' failed, line %d, file %s\n", #p ,    \
     2.8 +    printk("Assertion '%s' failed, line %d, file %s\n", p ,     \
     2.9                     __LINE__, __FILE__);                         \
    2.10      BUG();                                                      \
    2.11  } while (0)
    2.12 @@ -35,7 +35,7 @@ do {                                    
    2.13  
    2.14  #ifndef NDEBUG
    2.15  #define ASSERT(p) \
    2.16 -    do { if ( unlikely(!(p)) ) assert_failed(p); } while (0)
    2.17 +    do { if ( unlikely(!(p)) ) assert_failed(#p); } while (0)
    2.18  #else
    2.19  #define ASSERT(p) ((void)0)
    2.20  #endif