In one of our games, we cross-compile a Linux target from Windows.
We are currently having issues debugging the executable under Linux (e.g. debugging a core dump), since Windows-style paths are stored in the debug info.
GDB could not find the source file paths, even relative, as it interprets \ as a regular character inside a directory or file name.
This patch takes the approach of creating the DIFile with the native format of the target architecture, for both its filename and directory properties.
Using this patch and the -fdebug-prefix-map= argument, we can create fully compatible paths for gdb.
It looks like sys::path::native adjusts the slant of the slashes to match the target style, but it doesn't cope with things like drive letters, UNC paths, etc. I see how that would work for most cases when cross compiling from Windows to Posix, but I worry whether functions like sys::path::is_absolute will work properly when going the other way.
But the tests go both ways, so I guess it works well enough.