|
From: Anton V. <avo...@ya...> - 2011-07-14 00:06:28
|
13.07.2011, 23:17, "Sam Steingold" <sd...@gn...>:
>> * Anton Vodonosov <nib...@ln...>; [2011-07-13 20:42:47 +0400]:
>>
>> $ ./lisp.exe -q -norc -M lispinit.mem -x '(sys::program-name)'
>> "lisp.exe"
>
> OK, this is a bug and the cause of all the rest of your woes.
> could you please run the above in gdb, set a breakpoint in find_executable()
> and see why it does not put the full patch into executable_name.
> Apparently, GetModuleFileName puts "lisp.exe" into execname (execname.c:67).
> Is that the case?
No, you are looking at different piece of code. I am on cygwin.
See
#elif defined(UNIX)
#if defined(UNIX_LINUX) || defined(UNIX_CYGWIN32)
and below.
I tested with gdb. This code is executed:
if (realpath(program_name,executable_name) == NULL) {
free(executable_name); goto notfound;
}
Why realpath(program_name,executable_name) returns NULL?
I am not sure (it's inconvenient to debug when you are not used to gdb), but I see that
it enter the function defined at src/pathname.d, line 58:
#define realpath my_realpath /* avoid conflict with Consensys realpath declaration */
local char* realpath (const char* path, char* resolved_path) {
...
If you read the comment above the function: "...on some other systems,
notably on cygwin, we _do_ need the system implementation of realpath
because otherwise we get screwed..."
So on cygwin, we need to use system implementation of realpath,
instead of our own defined in pathname.d (actually called my_realpath).
I am finishing with it for today, because it's late. Probably this info will give you a clue
to the error. Otherwise I will need to learn gdb better to debug this.
Best regards,
- Anton
|