From patchwork Thu Jan 31 19:46:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ian Lance Taylor X-Patchwork-Id: 217247 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 685C42C008E for ; Fri, 1 Feb 2013 06:46:34 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1360266395; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: From:To:Subject:Date:Message-ID:User-Agent:MIME-Version: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=7dzU5Pk EZ0F5vkT/RK/bVb3gme0=; b=eQqdwZQeW7GVllJ80kvjxtVMONYqdNpAAHBzV2a mM+xxVHARucRlboVWESP2FiSEcqRcdTArz1HRo1vYEFCr/ASIWlQeTpdkJE4ikS9 ZuJHLTdqM3q7Hy1uLkIAt+WKgu2EqOQVLnY3/Cb8YjRgiMQH9n4rnnTj1hW/6c3I //Xs= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:X-Google-DKIM-Signature:X-Received:Received:From:To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:X-Gm-Message-State:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=kvNeRgTjyo0CCIK77mZzulQcfKJfeOCQESfi8SDWerC+bgmYWXO1yPDet6anse BaFiFfPa4W4GWGDuI3UncoeiAr+08YqtzNUK7yK02bsbGg12mAUDdLKzDfAknLAE c5YaPDDSf1lpiy9gqdzQZy8DS188XnvbMEwk0t2ls8qw0=; Received: (qmail 28630 invoked by alias); 31 Jan 2013 19:46:26 -0000 Received: (qmail 28605 invoked by uid 22791); 31 Jan 2013 19:46:25 -0000 X-SWARE-Spam-Status: No, hits=-5.3 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS X-Spam-Check-By: sourceware.org Received: from mail-pb0-f54.google.com (HELO mail-pb0-f54.google.com) (209.85.160.54) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Jan 2013 19:46:19 +0000 Received: by mail-pb0-f54.google.com with SMTP id rr4so1784036pbb.41 for ; Thu, 31 Jan 2013 11:46:19 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:subject:date:message-id:user-agent:mime-version :content-type:x-gm-message-state; bh=BFenU3k4kP2ISXG57uSamLKKaeAlB12kIDDEQ5CRntk=; b=pHAhyv2Svj9U1syUs3/w7nKTTpFqWC/Ydl78dDSWxCP7NTa+/5TKYAZnAjN4Ajvwnh bB/QeU2Oo1+bGU94VfRjctiAHk8qugoeWay48li9kZAHgVBUZHNydcsPUW4qGjrx1j0D 7kvdqF1rLpWhpvXpwvepwcSsb1xY9hWcud97yJk/Pu6hqEuB7WmYcaj3XtAB+uoPcg/n qRjKZJG2uTlSgj1DEhPAcc76DrBUbCzw9j5OpM5BaQSzLpPzX8xmJNupQPXNDpoN2Z20 sMae+oDzKyJBxj07/Ntn2grCveZaQ4Sr4BYzXqjkONQgijSJ48QXd1/QlHc0cTDGIyGU TsNA== X-Received: by 10.68.200.228 with SMTP id jv4mr24902890pbc.139.1359661579313; Thu, 31 Jan 2013 11:46:19 -0800 (PST) Received: from iant-glaptop.google.com ([172.26.54.189]) by mx.google.com with ESMTPS id sk1sm5873015pbc.0.2013.01.31.11.46.17 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 31 Jan 2013 11:46:18 -0800 (PST) From: Ian Lance Taylor To: gcc-patches@gcc.gnu.org, gofrontend-dev@googlegroups.com Subject: libgo patch committed: Remove confusion about split-stack backtrace Date: Thu, 31 Jan 2013 11:46:15 -0800 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlj2nvKuQL0HeJqBxR9CIBLl/6kZSk5qcxMTll2S94F/BTqx29GrHFuchLmzjsCBSxeOJNDjysQC6F/D0ZzE3GF4aVFQYsfJAF38f/VzDquMbv1sqGt2UoqhIwfr2VKgEb777LuqUvt4k+4D0MYBb6Mj0cacXHeDfYSNfQQwhIDJ2PPOrQ6e0LpUEJQSbnnPHwkE1VJ X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org In an earlier patch I tried to remove confusion about split-stack functions in backtraces, but it still doesn't work in conjunction with skipping functions. Both runtime.Callers and backtrace_full can skip stack frames. backtrace_full will count split-stack frames in the skip count, but runtime.Callers should not. In order to keep this consistent, this patch moves all the skip count handling to runtime.Callers. Bootstrapped and ran Go testsuite in x86_64-unknown-linux-gnu. Committed to mainline. Ian diff -r c205459490e5 libgo/runtime/go-callers.c --- a/libgo/runtime/go-callers.c Thu Jan 31 09:24:55 2013 -0800 +++ b/libgo/runtime/go-callers.c Thu Jan 31 11:42:48 2013 -0800 @@ -16,6 +16,7 @@ struct callers_data { Location *locbuf; + int skip; int index; int max; }; @@ -41,6 +42,12 @@ return 0; } + if (arg->skip > 0) + { + --arg->skip; + return 0; + } + loc = &arg->locbuf[arg->index]; loc->pc = pc; @@ -75,10 +82,11 @@ struct callers_data data; data.locbuf = locbuf; + data.skip = skip + 1; data.index = 0; data.max = m; - backtrace_full (__go_get_backtrace_state (), skip + 1, callback, - error_callback, &data); + backtrace_full (__go_get_backtrace_state (), 0, callback, error_callback, + &data); return data.index; }