RudjiGames / MTuner

MTuner is a C/C++ memory profiler and memory leak finder for Windows, PlayStation 4 and 3, Android and other platforms
BSD 2-Clause "Simplified" License
2.63k stars 145 forks source link

PDB files next to dll not loaded #67

Closed maidamai0 closed 1 year ago

maidamai0 commented 4 years ago

I build my application with a debug version, and all binary files like *.exe, *.dll, *.pdb are all in one folder. My debugger can find them all but Mtuner can not load them. So I have many unknown

image

I tried to add a path to the binary file path in Settings/Debug symbols/Local store and reload the capture file, still no symbol.

Where does MTuner find those symbol files?

milostosic commented 4 years ago

How did all the files end up in that one folder? Did you copy them? The path to PDB file is obtained from the executable and it shouldn't be needed to copy files around.

maidamai0 commented 4 years ago

Some dlls are compiled to there some are copied there. Is there any way to specify some paths to the pdb files?

milostosic commented 4 years ago

It's hard to tell what's going on like this. I would suggest to build MTuner from source and debug searching for debug symbols in rdebug library. Normally if I compile some project I can just drag&drop it to MTuner and everything works - no way to tell what is different on your side

maidamai0 commented 4 years ago

OK, thanks I will try this.

xakod commented 4 years ago

I have the same with qt+msvc

milostosic commented 4 years ago

Can either of you debug this and see what's going on? This problem clearly happens 'sometimes' and I would like to understand what conditions are needed to reproduce this.

maidamai0 commented 4 years ago

I had a look at the source code yesterday and found it very hard to build... :cry: No CMake, many dependencies.

maidamai0 commented 4 years ago

_NT_SYMBOL_PATH can help me find the Qt's pdb files. But the ones built myself in other places still can't load

milostosic commented 4 years ago

I don't use CMake because it's not good, I use GENie

Your last message shows why this issue is problematic - "can't load"? Are you sure? Does it fail loading or finding symbols? I think you simply don't know an answer to this one and you'd have to debug to find it out.

If you are willing to debug this problem then I will be happy to help you to setup compiling MTuner - it's really quite easy.

maidamai0 commented 4 years ago

I meant it can't find the symbols. CMake does have many problems but it is a popular one so it may be easier for someone.

I'm not familiar with GENie but I'll try again this weekend.

milostosic commented 4 years ago

You literally have only one command to execute with GENie, the choice of build script generating tool is irrelevant in this context.

Honeybunch commented 3 years ago

So, I am also having this issue. Also using CMake but in this case using LLVM for Windows rather than MSVC directly. LLVM for Windows does produce a valid PDB and the executable does point to it correctly. I can't test with MSVC to compare because I'm using some LLVM/GCC only language extensions for SIMD types.

The PDB also seems to be at least well formed enough for a tool like WinDBG to be able to provide stack traces and jump into source files like I would expect.

I have currently been trying to get setup to the point where I can build MTuner to try to give you some more detailed feedback here but it's turning into quite the chore. I got as far as needing lua dependencies but installing the lfs module seems to require installation from luarocks which I have been unable to get working; their installer for window seems to be broken as it prints an error when I try to ask it for its help message. After trying to get this building for a few hours I'm at a dead end.

Honeybunch commented 3 years ago

Just tried a different project with CMake but that I know builds with MSVC and it worked just fine. So in my case it's probably just an issue with LLVM for Windows and however that toolchain produces a PDB. If I can find some more time I'd like to try to get you some more details; getting this working with LLVM for Windows would be really helpful for me :)