From patchwork Thu Mar 3 20:48:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Feiner X-Patchwork-Id: 8496121 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 756D5C0554 for ; Thu, 3 Mar 2016 20:48:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A8D202025B for ; Thu, 3 Mar 2016 20:48:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C993F20392 for ; Thu, 3 Mar 2016 20:48:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757454AbcCCUsr (ORCPT ); Thu, 3 Mar 2016 15:48:47 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=tC0wA4fIQj2Lfmt4hnwNf+zViEH1MAlzQ7790e2LCcw=; b=oyNId3pTFD+yP2g7CUZ2QHquQQE3+vC/3mHo6RD1NVHUyot+iBtUn4wwGvt+mxZjGD pqRZf5HytjgF6q9buBJKZeDtV9ABAFM9tdDQO86psL7oTr0CBAjTX6yY+IfnuMiGf/XJ 1ocxeupFY1Hagi/BA67WAP8rxn1VeK4Rd86PC/y+f+el/ZCnU4+dWuLehDGmYgYeIaWh vid6HoQN5P8nmhvD7jkxU7M0tHcZjg2bJEFCqc+4UPtQx1jnFDfkY+X1tVo0uph7nY5M XxOJkXudo4UNfXx3uBHqan2SMzhjEpzEXp5HV0gGUNg5M7fiGDg5ei0xjdTfmmO2Mvtz ytiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=tC0wA4fIQj2Lfmt4hnwNf+zViEH1MAlzQ7790e2LCcw=; b=U8y/S8BYV5UXv5p6HKNj89HksIzwdKkqijvF2Nxh/sJfKkSNMdg21EZILOGKzQkldc nWagxCIZhvX3dvCo9yA8Uk3A/F2j16djc13tqhCv83xaDtz96uWJJnwxHwQuS9nh/G1G yIZBRTBpxOShn7pR6Tp20A7/eAyxX4pe/Xk6xFRj6KsaZaMqugXMQJOgdecOFNBClUr+ Qf/oudDil9EulkIbzNzsgXD69+7tLlJcDjUlOD0ZUJp2iZP+P5spyg0uBT7/IkJFD4fI ppvfhCpEWGgRp2/giKzdx1/HSeSdUCdN3fUP9JJfjEDp+c7KSWwJrtvUDKfeEXsl0fuy Lucw== X-Gm-Message-State: AD7BkJLPTWNgF5aE/CRDV7pbcGK9p4ZoSGdAM6wREdSh91ecaBi/OzaJuXYznl0o0ucgrLUK X-Received: by 10.66.124.167 with SMTP id mj7mr6541512pab.153.1457038124705; Thu, 03 Mar 2016 12:48:44 -0800 (PST) Received: from localhost ([2620:0:1009:3:48a8:c9fe:5013:71d]) by smtp.gmail.com with ESMTPSA id ux2sm164127pac.46.2016.03.03.12.48.43 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 03 Mar 2016 12:48:44 -0800 (PST) From: Peter Feiner To: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com Cc: pfeiner@google.com 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> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: <1457038116-3448-1-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> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Peter Feiner Reviewed-by: Andrew Jones --- 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