orbit
orbit copied to clipboard
Extracting the pdb name from the exe
We actually name our PDB something different from our exe
(sounds odd I know but we name the PDB to be the same as the final release name app.pdb) but the name of the exe we build during development contains other information in its name to allow side by side development
app.debug.x86.exe app.release.x64.exe
This is because the PDB name and the exe are joined at birth so when after we release our code, other tools like crash handlers, debuggers can find PDB and exe (because we name app.release.x64.exe to be app.exe and now both app.exe and app.pdb have the same prefix)
But this means when users use orbit during development in their area, they are constantly having to rename the binary from app.release.x64.exe to app.exe in order to match the PDB
I believe (and you know I should have checked in the code here first!), but I believe you are using the .exe name to find the .pdb name rather than looking inside the .exe or .dll to extract the PDB name
If that is the case, then the following blog might help. (not by me!) because I believe the PDB name is embedded inside the .exe
http://geekswithblogs.net/vaibhavgaikwad/archive/2011/12/12/148010.aspx
If I've got that wrong you can reject this, but if that's the case it's not finding the PDB correctly ;-)
Could it be here... in FindPdbs
std::wstring moduleName = ToLower( module->m_Name );
**std::wstring pdbName = Path::StripExtension( moduleName ) + L".pdb";**
Could not open your link but I found another article on the same subject:
https://deplinenoise.wordpress.com/2013/06/14/getting-your-pdb-name-from-a-running-executable-windows/
There is no need to load the name of the PDB from the EXE stream yourself. The DIA SDK already has a function to open a PDB associated with an EXE: IDiaDataSource::loadDataForExe.
A fix for this issue would be appreciated. I'd like to use OrbitProfiler on Chrome but it's PDBs have names like chrome.exe.pdb and chrome.dll.pdb. Working around that isn't impossible but it is inconvenient.
Using the appropriate support functions can also give you support for symbol servers, which are awesome. This would allow OrbitProfiler to automatically find PDBs that aren't stored beside the binary, such as Windows or Chrome PDBs, downloading them as needed.
Thanks for the comments and suggestions. This has come up a lot, I'll make this a priority. Expect the feature shortly.