<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/59878>59878</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            `CodeViewDebug::getFullFilepath()` breaks UNC paths on Windows
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          al13n321
      </td>
    </tr>
</table>

<pre>
    `CodeViewDebug::getFullFilepath()` in `CodeViewDebug.cpp` transforms file path in various ways. One of the transformations is replacing all occurrences of "`\\`" with "`\`". This breaks paths that start with "`\\?\`" - it turns into "`\?\`", which is invalid.

("`\\?\`" is a special prefix instructs Windows to skip parsing the path before passing it to filesystem, or something like that.)

One way to reproduce is to run Rust compiler:
```
rustc --emit asm -Cdebuginfo=2 '\\?\C:\temp\a.rs'
```
then look at the generated assembly file (`a.s` in this example). It'll say something like:
```
        .cv_file        8 "\\?\\C:\\temp\\a.rs" "C135F41EADC2F7248D34E03E64A04E8420BF5E4B" 2
```
(the backslashes are escaped by `PrintQuotedString()` in MCAsmStreamer.cpp. So escaped path "`\\?\\C:\\...`" corresponds to path "`\?\C:\...`")
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2PozgQ_TXOpRRkTCDkkEOaNNIe9rP347gqTCV4Y2zkMp3Jv1-ZyXZnWz2HQSgBU6_8XtVzIbM5O6K9KJ9EeVzhHAcf9mjzwhUqX3W-v-1FJRvf05-Grkfq5rMoDqI4nCm2s7WtsTRhHISqhdqJSoJx8BGR6WlKn2JAxycfRoaTsQQJmOJfMRg_M1zxxhn87Aj8CeJA7wCMxjsGwxBosqiNOwNaC17rOQRymjhhhFKikqJs0l1JoRRcTRwe1pfFDH4fDEMXCC-8sGCIA0bgiCF-hJSNKNr3hGswEeIcEh0X_UPgQ5RQDVwHo4dE2bhXtKbPhDwKebj_p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