I’m trying to debug a native extension, but when attaching the debugger does not allow me to set breakpoints.
- In Visual Studio 2022 it shows a ‘hollow’ breakpoint noting that “The breakpoint will not currently be hit. No symbols have been loaded for this document”.
- In raddebugger it will show a solid breakpoint, but it will simply not hit.
Here are some additional hints on what’s going on:
- In visual studio
__debugbreak()will break and after that everything works great, stepping work etc. but still no working breakpoints can be set. - In raddebugger when
__debugbreak()is hit it says it can’t find the file attmp/job17249374512224075876/upload/extension/src/[folder]/[source file with the debugbreak in it].cppThen I can lookup my the local source file and step, however when setting new breakpoints there, those will not hit. - In visual studio after hitting the
__debugbreak()I can step and set breakpoints through the Call Stack window on the current frame. These breakpoints do work and are hit. This probably works because the Call Stack window just sets a breakpoint in the current memory address, bypassing the local/temp file mapping. - In visual studio when right clicking in the source file and “Got to Disassembly” pops up an error saying “Disassembly cannot be displayed for the source location. There is not executable code at this location in the source code”. However when just opening the Disassembly window through “Debug > Windows > Disassembly” will work fine, I can see the disassembly and step through it.
So my best guess is: there is a problem with the *.pdb files where windows debuggers cannot make the link from tmp/job17249374512224075876/upload/extension/src/[folder]/[source file with the debugbreak in it].cpp to [my local project path]/extension/src/[folder]/[source file with the debugbreak in it].cpp.
Ideally the whole tmp/job17249374512224075876/upload/ should not be in the *pdb file. I have good hopes debuggers will be able to make the link if just a relative path is there.
I have no idea how to do that, but Gemini claims it’s a matter of passing /pathmap:" {job_upload_path}=" to cl.exe Where in this case [job_upload_path] would have been tmp/job17249374512224075876/upload/.
I have been looking around for a bit, and there is precious little information available about the /pathmap argument. I can use it locally with cl.exe but I also needed to add /experimental:deterministic.
Anyways, it would be awesome if that could be added to the extender ![]()