From patchwork Fri Mar 4 19:33:59 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Feiner X-Patchwork-Id: 8507141 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 6F574C0553 for ; Fri, 4 Mar 2016 19:34:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 94675201F2 for ; Fri, 4 Mar 2016 19:34:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A48462024D for ; Fri, 4 Mar 2016 19:34:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760012AbcCDTeZ (ORCPT ); Fri, 4 Mar 2016 14:34:25 -0500 Received: from mail-pf0-f182.google.com ([209.85.192.182]:34953 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759789AbcCDTeW (ORCPT ); Fri, 4 Mar 2016 14:34:22 -0500 Received: by mail-pf0-f182.google.com with SMTP id x188so16557726pfb.2 for ; Fri, 04 Mar 2016 11:34:22 -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=CLwil8YDQCmHAO/Wv8w2E8TtIs+AojPyCfeFvfwZyhgjqd8HIhmNGbr+E3lJGhdIJq Q50/Ct4XMR22mX+eXj3h9cCnVZa/gEsMGkw+Vgkx/UiC+w+F/GroVVxkfgjoBkMHK4UV cKm62AO822oWFThDsbXW3uSDFMY8TE2sGlcSUmN0uTrzrhM8k6m+c4K0uoPG4JwdXLZ7 1EhAWS7dySS4oowg1IRYZdEMVu2MMkUwuEdFM/45Q9ax3gTt4IjUSuYRYgrsL+kFQrub OxNJed2P1jF7K0mtJIx5BYH4GBq0n2Zjk776dHVCgL454E4Kph4a7I5ZpACwJCZAHONX jmhA== 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=Y3GS52/qCRbEGsHpcwKhBYHDnTqqpvvW9G3HK1ex97OXuOdqnTF0Ko81k9JNu6A/Do WlovZliKBAqeujtY2ICXZafRb6vWfMSWemzCVd45M5gtb8rb7/loLSroLvv4T9b4LOs9 eDTIJl8CUaqh+2nUmCnzODwqJSN6mTj0DOS/09DnVLJzgdmVyO7yGoSCv1rqO0RX5A3R h6lVtJ8wOsqC4KIyDcn4bF4A3fyWCamho9T5NraDhQCYcMT0vVhF80rRPCJg63XwDdhB VAXeuQ4I/GxWs1l/pFjb0yoO6n1Hoj9rfGbK4XCO6/zhOG1Ul5lzNNsC79wRcjzkTeDg ygPA== X-Gm-Message-State: AD7BkJKpqKVCFRyCvGkaWE/ZK5zxeaY4gTP3CLsjn+GVkDuMowBflRBj9dU4lzCVGPfFcM/G X-Received: by 10.98.10.133 with SMTP id 5mr14605974pfk.75.1457120061730; Fri, 04 Mar 2016 11:34:21 -0800 (PST) Received: from localhost ([2620:0:1009:3:90d6:d6fe:49e8:86b0]) by smtp.gmail.com with ESMTPSA id h19sm7306213pfh.43.2016.03.04.11.34.20 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 04 Mar 2016 11:34:21 -0800 (PST) From: Peter Feiner To: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com Cc: Peter Feiner Subject: [PATCH kvm-unit-tests v4 3/5] lib: dump stack on failed assert() Date: Fri, 4 Mar 2016 11:33:59 -0800 Message-Id: <844e4178b18ab775ab00f45cfa2740d645d0ee6c.1457119891.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=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 --- 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