<div dir="rtl"><div dir="ltr">DWARF info and the patch are relevant only for mingw32 toolchain, not MS toolchain, of course.</div><div dir="ltr"><br></div><div dir="ltr">gcc (MinGW) toolchain is inconsistent handling path seperators.</div>

<div dir="ltr">Compile m.c=</div><div dir="ltr"><br></div><div dir="ltr">  int main() { return 0; }</div><div dir="ltr"><br></div><div dir="ltr">with </div><div dir="ltr"><br></div><div dir="ltr">  cd c:\test</div><div dir="ltr">

  gcc m.c m.c -g -o m.exe</div><div dir="ltr"><br></div><div dir="ltr">To get</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr">C:\Users\user\AppData\Local\Temp\ccjRtBrL.o: In function `main':</div><div dir="ltr">

<b>c:\test/m.c</b>:1: multiple definition of `main'</div><div dir="ltr">C:\Users\user\AppData\Local\Temp\cc60AUBa.o:<b>c:\test/m.c</b>:1: first defined here</div><div dir="ltr">collect2.exe: error: ld returned 1 exit status</div>

<div dir="ltr"><br></div><div>so \ in directory name but / between directory and filename, incosistent.</div><div><br></div><div>if you generate assembly</div><div><br></div><div>  gcc c:\test\m.c -S -g -o m.s</div><div>
<br>
</div><div>the assembly file</div><div><div><span class="" style="white-space:pre">     </span>.file 1 "c:/test/m.c"</div></div><div><span class="" style="white-space:pre">        </span>.ascii "c:\\test\\m.c\0"<br>

</div><div><br></div><div>gdb is also quirky, unrelated to debug info:</div><div><br></div><div>  gcc m.c -o m.exe</div><div>  gdb m.exe</div><div>  Reading symbols from <b>c:\test\m.exe</b>...done.<br></div><div><div>  (gdb) r</div>

<div>  Starting program: <b>c:\test/m.exe</b></div></div><div><br></div><div>Back to clang, directories could be normalized to / but not the case now. If we make an error:</div><div><br></div><div>  int main() { return e; }<br>

</div><div><br></div><div>and run clang -c -g c:/test/m.c -o m.o -target i686-pc-mingw32 we get</div><div><b>c:/test/m.c</b>:1:21: error: use of undeclared identifier 'e'<br></div><div>but if we run clang -c -g c:\test\m.c -o m.o -target i686-pc-mingw32 we get</div>

<div><b>c:\test\m.c</b>:1:21: error: use of undeclared identifier 'e'<br></div><div><br></div><div>so it follows the input. </div><div><br></div><div>In DWARF info the path sep. in directories follows input in some fields and normalized to host \\ in others but is never normalized to / so hardcoding / in MCDWARF does not match this behaviour.</div>

<div><br></div><div>Yaron</div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div dir="ltr"><br></div></div><div dir="ltr"><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">

<div dir="ltr">2014-03-17 9:32 GMT+02:00 NAKAMURA Takumi <span dir="ltr"><<a href="mailto:geek4civic@gmail.com" target="_blank">geek4civic@gmail.com</a>></span>:</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Does dwarf affect "Your Windows"? I suppose MS toolchain would be<br>
innocent of dwarf.<br>
Would mingw emit '\\' as pathsep in dwarf? I'll investigate later.<br>
(IIRC, it wouldn't)<br>
I assume "preferred_separator" depends on host system. Would you<br>
really like to emit '\\' on Windows targeting elf?<br>
<br>
IMO, pathsep should be always normalized to '/' unless it would be illegal.<br>
<br>
2014-03-17 16:18 GMT+09:00 Yaron Keren <<a href="mailto:yaron.keren@gmail.com">yaron.keren@gmail.com</a>>:<br>
<div><div class="h5">> The path seperator is hardcoded in MCDwarf.cpp:649 as '/'. This is worng on<br>
> Windows.<br>
><br>
> A patch to use the correct path seperator is attached. I had to expose the<br>
> path seperator from llvm::sys::path.<br>
><br>
> Yaron<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> cfe-commits mailing list<br>
> <a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a><br>
><br>
</blockquote></div><br></div>