From patchwork Mon Mar 7 17:46:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Feiner X-Patchwork-Id: 8521461 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 6E9ADC0553 for ; Mon, 7 Mar 2016 17:47:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C2112027D for ; Mon, 7 Mar 2016 17:47:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C35EE202B8 for ; Mon, 7 Mar 2016 17:47:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753462AbcCGRrL (ORCPT ); Mon, 7 Mar 2016 12:47:11 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:36254 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752859AbcCGRrE (ORCPT ); Mon, 7 Mar 2016 12:47:04 -0500 Received: by mail-pa0-f52.google.com with SMTP id tt10so20240799pab.3 for ; Mon, 07 Mar 2016 09:47:04 -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=iq62BQTc41d8d05J0DqJUnHErCOd/EPkWcoanUedCg3MsNe1KJbWzVUlx/MaPMQmYM RWR3YrRE2IBTk6vQocYtpxxOn+FMQMAnlGth6FC43V4c1G7CMSpfYQRY+pdIEKWSBcdK 8EfSnKTvl796ULJQkyPHl9qpOrEWDZiVCIvJsENJ9VdGjq/T1/KT5xiwUyEM0pLnvDUy JPEq+mBJs8dHh+bj4nj1PHpgE3ikilrTs6pbQusFwD9BTt9ZHS/6WHUKuznbF6cx0+dl uuX4j4S8MGFPVyEElIG5WiG8RGbDZiFJochieZIGQaY3ptPq751zBNy3N/mQRTIJzxQq e0+Q== 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=dkmVLnlRFwmNnK8eKljX26kmxB44OyLgRD079mA6xaoDhkrNF/55tyMMBA1sZN3Qvp 9vps6TF+FtQph1/fczi9gVbq+EwxDR9oosB5juakaNbxqlPYkSt+CtdOPj1jsAtr5bEZ rslmoWmaBplbRTjNyoUcIt1u+8CYdmHnPxjWpjUDuKPzjmxZyBRJ8jMAwKRLgoDkBKLv ECvIL4CKAjQbCmjKq3D9JK08MI2Oa3P8auM5JVgor0VkPzNFQADBIHtY9+IQR87p1D5z 2kRbJ6Hk3OPIB8q5ApHTxUnS/z8RfkBuoWzEe87zJddPbvOCA9t85CXS7aMynUBIiTbX GqTw== X-Gm-Message-State: AD7BkJLxLtMsve+UKqGOB9YDsjIMX+9Filg2FLd2HsbYeB0brNWvX+mjmEEQI95DKlEWaZ4j X-Received: by 10.66.100.228 with SMTP id fb4mr34645892pab.84.1457372824023; Mon, 07 Mar 2016 09:47:04 -0800 (PST) Received: from localhost ([2620:0:1009:3:d845:64d7:b824:3f90]) by smtp.gmail.com with ESMTPSA id 17sm5378437pfs.40.2016.03.07.09.47.03 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 07 Mar 2016 09:47:03 -0800 (PST) From: Peter Feiner To: kvm@vger.kernel.org, drjones@redhat.com, pbonzini@redhat.com Cc: Peter Feiner Subject: [PATCH kvm-unit-tests v5 3/5] lib: dump stack on failed assert() Date: Mon, 7 Mar 2016 09:46:55 -0800 Message-Id: <844e4178b18ab775ab00f45cfa2740d645d0ee6c.1457372594.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