From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27607 invoked by alias); 3 Dec 2013 20:27:37 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 27594 invoked by uid 89); 3 Dec 2013 20:27:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.7 required=5.0 tests=AWL,BAYES_00,RDNS_NONE,SPF_HELO_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 03 Dec 2013 20:26:15 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id rB3KQ7Mv016499 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 3 Dec 2013 15:26:07 -0500 Received: from barimba (ovpn-113-124.phx2.redhat.com [10.3.113.124]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id rB3KQ5u6028641 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Tue, 3 Dec 2013 15:26:06 -0500 From: Tom Tromey To: Hui Zhu Cc: gdb-patches ml Subject: Re: [PATCH] Make "backtrace" doesn't print python stack if init python dir get fail References: <52974146.70805@mentor.com> <8761r7w85h.fsf@fleche.redhat.com> <529D8865.80503@mentor.com> Date: Tue, 03 Dec 2013 20:27:00 -0000 In-Reply-To: <529D8865.80503@mentor.com> (Hui Zhu's message of "Tue, 3 Dec 2013 15:29:41 +0800") Message-ID: <87li01smua.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-12/txt/msg00103.txt.bz2 >>>>> "Hui" == Hui Zhu writes: Hui> I got a issue is ensure_python_env check gdb_python_initialized and Hui> throw error if it is 0. So gdb_python_initialized to 0 will make Hui> some commands throw error when python dir has something error. I Hui> removed this check in the patch. I think that's a useful consistency check, so better left in place. Two other approaches are possible here instead. One, change finish_python_initialization to do the needed bit of locking by handy, not using ensure_python_env. Or, two, don't release the GIL until somewhere in finish_python_initialization, and then it doesn't need to call ensure_python_env at all. Tom