From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21519 invoked by alias); 17 Jan 2012 06:48:22 -0000 Received: (qmail 21506 invoked by uid 22791); 17 Jan 2012 06:48:18 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MISSING_HEADERS,RCVD_IN_DNSWL_LOW,TW_DB,TW_SM X-Spam-Check-By: sourceware.org Received: from mail-iy0-f169.google.com (HELO mail-iy0-f169.google.com) (209.85.210.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Jan 2012 06:48:05 +0000 Received: by iadj38 with SMTP id j38so2755853iad.0 for ; Mon, 16 Jan 2012 22:48:05 -0800 (PST) Received: by 10.43.46.196 with SMTP id up4mr12769830icb.23.1326782885447; Mon, 16 Jan 2012 22:48:05 -0800 (PST) Received: from [222.205.42.7] ([222.205.42.7]) by mx.google.com with ESMTPS id he16sm74029040ibb.9.2012.01.16.22.48.01 (version=SSLv3 cipher=OTHER); Mon, 16 Jan 2012 22:48:04 -0800 (PST) Message-ID: <4F151804.6040000@gmail.com> Date: Tue, 17 Jan 2012 07:00:00 -0000 From: Asmwarrior User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.0 MIME-Version: 1.0 CC: Doug Evans , Pierre Muller , Eli Zaretskii , Tom Tromey , gdb-patches@sourceware.org Subject: Re: Possible fix for mingw32 directory relocation problems References: <4f143c35.4fecd80a.473e.ffffbd75SMTPIN_ADDED@mx.google.com> <4F150434.3020102@gmail.com> <4F15111E.3060904@gmail.com> In-Reply-To: <4F15111E.3060904@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2012-01/txt/msg00585.txt.bz2 On 2012-1-17 14:11, asmwarrior wrote: > char * > make_relative_prefix (const char *progname, const char *bin_prefix, > const char *prefix) > > Now, the arguments maybe looks like: > progname = "e:/mymingw/bin/gdb.exe" (this is the folder you > copy to) > bin_prefix=BINDIR = "E:/msys/mingw32/msys/1.0/local/bin" > prefix = "/usr/local/share/gdb" > > The return value should be a "relative path" to ""e:/mymingw/bin/" > > Right? > > asmwarrior Ok, the comments under: \libiberty\make-relative-prefix.c line 217 clearly said it should work. (it also give us an example about path handling) /* Given three strings PROGNAME, BIN_PREFIX, PREFIX, return a string that gets to PREFIX starting with the directory portion of PROGNAME and a relative pathname of the difference between BIN_PREFIX and PREFIX. For example, if BIN_PREFIX is /alpha/beta/gamma/gcc/delta, PREFIX is /alpha/beta/gamma/omega/, and PROGNAME is /red/green/blue/gcc, then this function will return /red/green/blue/../../omega/. If no relative prefix can be found, return NULL. */ static char * make_relative_prefix_1 (const char *progname, const char *bin_prefix, const char *prefix, const int resolve_links) PS: make_relative_prefix() internally call make_relative_prefix_1(). asmwarrior ollydbg from codeblocks forum