From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99282 invoked by alias); 1 Mar 2018 13:18:04 -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 98840 invoked by uid 89); 1 Mar 2018 13:18:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 01 Mar 2018 13:18:02 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w21DHu40020025 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 1 Mar 2018 08:18:01 -0500 Received: by simark.ca (Postfix, from userid 112) id 591761F42D; Thu, 1 Mar 2018 08:17:56 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 83AF91E5AF; Thu, 1 Mar 2018 08:17:53 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 01 Mar 2018 13:18:00 -0000 From: Simon Marchi To: Christophe Lyon Cc: Joel Brobecker , Sergio Durigan Junior , GDB Patches , Simon Marchi , Pedro Alves Subject: Re: [PATCH v3 0/2] Make gdbserver work with filename-only binaries In-Reply-To: References: <20180210014241.19278-3-sergiodj@redhat.com> <20180228032708.19670-1-sergiodj@redhat.com> <87sh9ka5ze.fsf@redhat.com> <20180301025528.zyh5m5jls45t3ooa@adacore.com> Message-ID: <7ed90d000b4959a1d65372caf50a2f24@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.4 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 1 Mar 2018 13:17:56 +0000 X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00020.txt.bz2 On 2018-03-01 08:08, Christophe Lyon wrote: > These new patches seem to cause problems with building for ming (using > i686-w64-mingw32-g++): > > /gdb/common/pathstuff.c: In function 'gdb::unique_xmalloc_ptr > gdb_realpath(const char*)': > /gdb/common/pathstuff.c:56:14: error: 'MAX_PATH' was not declared in > this scope > char buf[MAX_PATH]; > ^ > /gdb/common/pathstuff.c:57:5: error: 'DWORD' was not declared in this > scope > DWORD len = GetFullPathName (filename, MAX_PATH, buf, NULL); > ^ > /gdb/common/pathstuff.c:57:11: error: expected ';' before 'len' > DWORD len = GetFullPathName (filename, MAX_PATH, buf, NULL); > ^ > /gdb/common/pathstuff.c:63:9: error: 'len' was not declared in this > scope > if (len > 0 && len < MAX_PATH) > ^ > /gdb/common/pathstuff.c:64:54: error: 'buf' was not declared in this > scope > return gdb::unique_xmalloc_ptr (xstrdup (buf)); > ^ > make[2]: *** [pathstuff.o] Error 1 > > I saw this while rebuilding branch 8.1, I didn't check master. > > Sorry if this has already been reported, I can't find any mention of > this problem in the list archives. > > I suspect there's already a recommended way of handling MAX_PATH > cross-platform. > > Thanks > > Christophe MAX_PATH is windows specific, note that this code is in an #if defined (_WIN32) guard. I think we just need to add #include with the same guard. Simon