Thu 14 Jun 2007 04:43:40 AM UTC, original submission:
Hi,
this is already known problem and i have feeling that it needs to be documented.
For reproducing this bug you need cygwin and pnet build with --disable-cygwin.
Try building attached sample under cygwin. You'll get following output:
$ make
csant
Building project `ConsoleApp2'
Building target `all' for project `ConsoleApp2'
cscc -o .\ConsoleApp2.exe -g -DDEBUG -DTRACE .\subdir\ConsoleApp2.cs -L. -lSyste
m.Xml -L. -lSystem -L. -lmscorlib
Leaving target `all' for project `ConsoleApp2'
Ending project `ConsoleApp2'
Until now everything seems ok. But now open the resulting binary in some hex editor. Search for string ".\subdir\ConsoleApp2.cs" - it should be in the debug section (after ILDB string). But it's not there! Instead there is string ".subdirConsoleApp2.cs".
What's wrong? I am not sure. It looks like cygwin does not like backslashes and paths in windows style. It's simple to try:
$ cat .\subdir\ConsoleApp2.cs
cat: .subdirConsoleApp2.cs: No such file or directory
The path passed to cat command is clobbered exactly the same way as paths in debug info.
What can we do?
We can investigate what's going on in cygwin and why are windows style paths clobbered. We can write patch for cygwin, but more likely we will find out that it's not bug but "by design" feature. Perhaps it's only problem of bash. Anyway digging into this is imho wasted time.
Solution 1 is is attached one liner patch. It makes csant use always normal slashes instead of backslashes. Cygwin is happy and windows understand normal slashes without problems too. Another good thing is that the paths in debug info will look the same when compiled on linux and on windows.
Another option would be to make csant quote paths as stated here:
http://publib.boulder.ibm.com/infocenter/tivihelp/v16r1/index.jsp?topic=/com.ibm.tivoli.tpm.wkf.doc/workflows/twkf_cygcommands.html
I prefer the first solution. I could have commited myself, but i need to know that everybody agrees with it.
Any comments are welcome.
Radek
|