This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Possible fix for mingw32 directory relocation problems
- From: Asmwarrior <asmwarrior at gmail dot com>
- Cc: Doug Evans <dje at google dot com>, Pierre Muller <pierre dot muller at ics-cnrs dot unistra dot fr>, Eli Zaretskii <eliz at gnu dot org>, Tom Tromey <tromey at redhat dot com>, gdb-patches at sourceware dot org
- Date: Tue, 17 Jan 2012 14:41:08 +0800
- Subject: Re: Possible fix for mingw32 directory relocation problems
- References: <4f143c35.4fecd80a.473e.ffffbd75SMTPIN_ADDED@mx.google.com> <CAFVy0AZA2KqDiv+tRyX1RZweLMDw3Q5nsEEm628ixN2WiLdrtw@mail.gmail.com> <CADPb22SvBMEt9=EwMNZE6m+=_jfJZxTt1C2Pn-rH9OpHKUJCJQ@mail.gmail.com> <4F150434.3020102@gmail.com> <CADPb22TK7_csatjnORZoLeuRty9aXM+=hzBykYeWk6XzG-aPjQ@mail.gmail.com> <4F15111E.3060904@gmail.com>
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