This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Return argv0-symlink.exp early if gdb can't load symlink
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Yao Qi <yao at codesourcery dot com>
- Cc: palves at redhat dot com, gdb-patches at sourceware dot org
- Date: Wed, 02 Apr 2014 19:47:50 +0300
- Subject: Re: [PATCH] Return argv0-symlink.exp early if gdb can't load symlink
- Authentication-results: sourceware.org; auth=none
- References: <1396428218-31822-1-git-send-email-yao at codesourcery dot com> <533BD0D5 dot 4000408 at codesourcery dot com> <533BEAA8 dot 4080100 at redhat dot com> <533C18DA dot 3000307 at codesourcery dot com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Wed, 2 Apr 2014 22:04:10 +0800
> From: Yao Qi <yao@codesourcery.com>
> CC: <gdb-patches@sourceware.org>
>
> > In case you're running the tests on a Windows system that
> > supports it, did you try just setting winsymlinks:native in your
> > CYGWIN? Things then should work IIUC. If GDB can't load
> > native Windows symlinks, then that sounds like a real GDB
> > bug to me.
>
> Yes, I tried that, and GDB still failed to load symlink.
What do you mean by "load"? Which command failed?
Native Windows symlinks are transparently resolved by functions that
open files, so if "load" above means "open and read", I would expect
that to work in GDB without any problems. Assuming those were native
Windows symlinks, of course, and not Cygwin emulations.
> If we want to test GDB reading native windows symlink, why don't we
> write code to create symlink via CreateSymbolicLink
> (http://msdn.microsoft.com/en-us/library/windows/desktop/aa363878(v=vs.85).aspx)?
As I wrote elsewhere, it will either trigger UAC elevation prompts, or
just silently fail. You need to start a shell "As Administrator", and
run the test suite from that shell, for this to succeed. And if you
are willing to go to those lengths, simply use the mklink command
provided with Windows to create native symlinks.
> No idea how to detect such Windows system in procedure off hand.
Can you probe the Windows version? Symlinks are available with
Windows Vista and later. Or just check if issuing "mklink" command
emits error message from cmd.exe.