Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

PDB paths are not searched by PE module processor #777

Closed
ranweiler opened this issue Apr 6, 2021 · 5 comments · Fixed by #779
Closed

PDB paths are not searched by PE module processor #777

ranweiler opened this issue Apr 6, 2021 · 5 comments · Fixed by #779
Assignees
Labels
bug Something isn't working

Comments

@ranweiler
Copy link
Member

When we process PE modules for disassembly in coverage::pe::process_modules(), we only try to resolve the PDB using the CV filename attr.

Instead, we should ideally search in the same way dbghelp API would, as seen here. In particular, we must make sure that we include the directory containing the PE.

@ranweiler ranweiler added the bug Something isn't working label Apr 6, 2021
@ranweiler ranweiler self-assigned this Apr 6, 2021
@ranweiler ranweiler mentioned this issue Apr 7, 2021
5 tasks
@ranweiler
Copy link
Member Author

Note: this doesn't impact the custom debugger, because that uses symbol handler APIs. This issue is limited to here.

@lzybkr
Copy link
Member

lzybkr commented Apr 7, 2021

The dbghelp API to use is SymFindDebugInfoFileW.

It does require some setup (which our debugger does when asked) - namely calling SymInitializeW and SymLoadModuleExW.

@ranweiler
Copy link
Member Author

Hmm, it looks like SymFindDebugInfoFileW() is only meant for .dbg files.

I think we can accomplish what we want by getting the search path with SymGetSearchPathW(), and then using SymFindFileInPathW() to search for the expected .pdb.

@lzybkr
Copy link
Member

lzybkr commented Apr 7, 2021

Ugh, yes. Not sure how I found the correct api after finding that one, but still linked to the wrong one. Sorry about that.

@lzybkr
Copy link
Member

lzybkr commented Apr 7, 2021

Note that you can pass NULL for the SearchPath and it will pick up the path set from SymInitialize (which we also pass NULL so we pick up the default.)

@ghost ghost locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants