From: Peter Feiner Subject: [kvm-unit-tests v3 3/4] lib: dump stack on failed assert() Date: Thu, 3 Mar 2016 12:48:35 -0800 Message-ID: <1457038116-3448-4-git-send-email-pfeiner@google.com> References: <1456867658-10937-1-git-send-email-pfeiner@google.com> <1457038116-3448-1-git-send-email-pfeiner@google.com> Cc: pfeiner@google.com To: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com Return-path: Received: from mail-pa0-f49.google.com ([209.85.220.49]:33500 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756948AbcCCUsp (ORCPT ); Thu, 3 Mar 2016 15:48:45 -0500 Received: by mail-pa0-f49.google.com with SMTP id fl4so21030607pad.0 for ; Thu, 03 Mar 2016 12:48:45 -0800 (PST) In-Reply-To: <1457038116-3448-1-git-send-email-pfeiner@google.com> Sender: kvm-owner@vger.kernel.org List-ID: Signed-off-by: Peter Feiner --- lib/libcflat.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libcflat.h b/lib/libcflat.h index 55bddca..df50615 100644 --- a/lib/libcflat.h +++ b/lib/libcflat.h @@ -92,10 +92,12 @@ extern void dump_frame_stack(const void *instruction, const void *frame); #define assert(cond) \ do { \ - if (!(cond)) \ + if (!(cond)) { \ printf("%s:%d: assert failed: %s\n", \ - __FILE__, __LINE__, #cond), \ + __FILE__, __LINE__, #cond); \ + dump_stack(); \ abort(); \ + } \ } while (0) #endif -- 2.7.0.rc3.207.g0ac5344