From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 91815 invoked by alias); 22 Aug 2019 22:48:05 -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 91786 invoked by uid 89); 22 Aug 2019 22:48:04 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.2 required=5.0 tests=AWL,BAYES_00,ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham version=3.3.1 spammy=Marchi, marchi, our X-HELO: mail-ot1-f67.google.com Received: from mail-ot1-f67.google.com (HELO mail-ot1-f67.google.com) (209.85.210.67) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Aug 2019 22:48:02 +0000 Received: by mail-ot1-f67.google.com with SMTP id o101so7014723ota.8 for ; Thu, 22 Aug 2019 15:48:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kggGZwwE7RvD5bSps9dPsyiV1GmYv6IeFnYGnoTwbpU=; b=Q+X2dTRoVp68dG6bwSfL2yJid1XHPLi8smnzy8C/jTQnr20sV6Sf/2KYgfUTyvuGRZ eJaVnyGX7Uub/K/5almTBtalAkq84LkAZFFxtjoM5bOzu20mFXQVPwhDddz+wiWp99Zp 1DFmT0S0Avc3r7RsNzRZ7tAuRDImVWnTY0q2CNDH7xKamn+eGCdvNFCBfjID/HJln7Hz rHBJeD2EVisT4iQ47f8LlYe+Dw/8Bm3xX90aiHP2f95Lz0qdQCQtsmrhhpqf1TF8GjFb JAN97v5+fL881UVrIbEdPTVzs1O1hsDMeyR4HIpfPyRXsNGfx3yKR0JhjJyraOQvndPA Dy7Q== MIME-Version: 1.0 References: <20190815184942.19371-1-cbiesinger@google.com> In-Reply-To: From: "Christian Biesinger via gdb-patches" Reply-To: Christian Biesinger Date: Thu, 22 Aug 2019 22:48:00 -0000 Message-ID: Subject: Re: [PATCH v4] Make GDB compile with Python 3 on MinGW To: Simon Marchi Cc: gdb-patches Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-08/txt/msg00541.txt.bz2 On Thu, Aug 22, 2019 at 5:24 PM Simon Marchi wrote: > > On 2019-08-15 2:49 p.m., Christian Biesinger via gdb-patches wrote: > > PyFile_FromString and PyFile_AsFile have been removed in Python 3. > > There is no obvious replacement that works here, and we can't just > > pass our FILE* to a DLL in Windows because it may use a different > > C runtime. > > > > So we just call a Python function which reads and executes file > > contents. Care must be taken to execute it in the context of > > __main__. > > > > Tested by inverting the ifdef and running the testsuite on Debian > > Linux (even without the patch, I failed at running the testsuite > > on Windows). I did test with both Python 2 and 3. > > > > gdb/ChangeLog: > > > > 2019-08-13 Christian Biesinger > > > > * python/lib/gdb/__init__.py: Add an execute_file function. > > This can be written as: > > * python/lib/gdb/__init__.py (_execute_file): New function. > > > * python/python.c (python_run_simple_file): Call gdb.execute_file > > on Windows. > > Please update "execute_file" to "_execute_file" in both entries. > > The patch LGTM with this fixed. Thanks, pushing now with that fixed. Christian