From patchwork Fri Mar 11 00:47:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Feiner X-Patchwork-Id: 8561171 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7EC889F38C for ; Fri, 11 Mar 2016 00:48:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ACCC52015E for ; Fri, 11 Mar 2016 00:48:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 97BC220382 for ; Fri, 11 Mar 2016 00:48:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933083AbcCKArx (ORCPT ); Thu, 10 Mar 2016 19:47:53 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:33886 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933063AbcCKArw (ORCPT ); Thu, 10 Mar 2016 19:47:52 -0500 Received: by mail-pf0-f179.google.com with SMTP id 129so81363131pfw.1 for ; Thu, 10 Mar 2016 16:47:52 -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 :in-reply-to:references; bh=tC0wA4fIQj2Lfmt4hnwNf+zViEH1MAlzQ7790e2LCcw=; b=c2wBfrkrvm60jjhVILvGQFokGbK8JbQJIHouWvOYWh1Olsj5AWy+PWxLl0UITTHWRg mpR17K5hRxKyys5/cddFVM58fKx6IUtwOLf4/y63U8SbT3kFtVArCIeDDgphnNwYlAX2 CdKJoVPAJpl6+wZucKsRpltmzvnIiYwe2xFtrtq1RH9AX7DyVFI7oSFDPnzl5lU2wIpw smRyaTdbYmwloEcbeD7lQU1OyiWV7FqwxU12zxDUn2SNHzzHqIGLvCzk5mHHrd+qPKWn LAOFarlopuT0SqcP1cJjTcJQBx7/eMtCdZk6ddV3kgQfu7Ot2HVPmo5adx41lVX6nUYh AL+A== 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:in-reply-to:references; bh=tC0wA4fIQj2Lfmt4hnwNf+zViEH1MAlzQ7790e2LCcw=; b=TOkfvGpsCIFCkt7Mm/b6Qh+hwQzje0Ti4GirKN8r7OcYjW0aG7Nj6Unoj8bpjNdeg/ 5lZKPMS6GH7ZKlpH6op3nOUnhMqaBeif5ZctABvYk9fgC1OfL8htLsWcIUFxS1PaTFOf yXrKSu/OQR0TeKOibhXG5HHW46gxu1MdSn65mdVNokfwgrK7LhmjP0fA3pkhRcrLKYsE tTRkdazR419VnmioOrq+sRlgBVPDIbOOFpdzsy/gKSauDEY8LOHy/8sllIBVxiQPxbiD byki9d+xEdVLSXhDZpQ8ziYsb5SYnJdKEbPKRGATd5/zX5SXEMwWfVy9ocpchmufDU82 fQ8w== X-Gm-Message-State: AD7BkJJ53wysqkMGSokkC9W0Z1JJPxgEf2ahBFnlmBAJSJr/qqdAerR3qXCtMdHpZPv63n/e X-Received: by 10.98.14.149 with SMTP id 21mr9314122pfo.79.1457657271627; Thu, 10 Mar 2016 16:47:51 -0800 (PST) Received: from localhost ([2620:0:1009:3:fd91:211e:47f5:d0b0]) by smtp.gmail.com with ESMTPSA id p75sm8151267pfi.29.2016.03.10.16.47.51 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 10 Mar 2016 16:47:51 -0800 (PST) From: Peter Feiner To: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com Cc: Peter Feiner Subject: [PATCH kvm-unit-tests v6 3/5] lib: dump stack on failed assert() Date: Thu, 10 Mar 2016 16:47:37 -0800 Message-Id: <581a5506e0703907ba8bde6e58e368cc02236405.1457656962.git.pfeiner@google.com> X-Mailer: git-send-email 2.7.0.rc3.207.g0ac5344 In-Reply-To: References: In-Reply-To: References: 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=unavailable 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 --- 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