From 31fb0552201f4d494adb35dfebb73fdadaee06e6 Mon Sep 17 00:00:00 2001 From: Andrey Vagin Date: Tue, 17 Jan 2012 11:27:29 +0300 Subject: [PATCH] restorer: make BUG_ON more informative Signed-off-by: Andrey Vagin Acked-by: Pavel Emelyanov --- include/util.h | 6 +++++- restorer.c | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/util.h b/include/util.h index c7dc8df92..9de72cd01 100644 --- a/include/util.h +++ b/include/util.h @@ -90,8 +90,12 @@ extern void printk(const char *format, ...); #ifdef CR_NOGLIBC #define BUG_ON_HANDLER(condition) \ do { \ - if ((condition)) \ + if ((condition)) { \ + write_string("BUG at " __FILE__ ": "); \ + write_num(__LINE__); \ + write_string("\n"); \ *(unsigned long *)NULL = 0xdead0000 + __LINE__; \ + } \ } while (0) #else # define BUG_ON_HANDLER(condition) \ diff --git a/restorer.c b/restorer.c index 8b39b7283..e481cbdae 100644 --- a/restorer.c +++ b/restorer.c @@ -12,11 +12,11 @@ #include "compiler.h" #include "types.h" #include "syscall.h" +#include "restorer-log.h" #include "util.h" #include "image.h" #include "crtools.h" -#include "restorer-log.h" #include "lock.h" #include "restorer.h"