This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Possible fix for mingw32 directory relocation problems


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]