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

Where does it expect pdb to be? #101

Open WhiteBlackGoose opened 1 year ago

WhiteBlackGoose commented 1 year ago

Hello, and thanks for this amazing software!

My preferred workflow is: profiling an app on Windows machine, then downloading the MTuner report along with the pdb file, and running MTuner via Wine on a linux machine. Naturally I don't expect support of this scenario, but maybe I'm missing something easy?

The problem is that it doesn't load debug symbols, so all functions and locations appear as "unknown" in the GUI. I tried putting the pdb file (and, for the record, the exe one) in the same folder as the MTuner report and tried to point Local Store path to the directory with the pdb file, but it still doesn't seem to load them. What can I do?

Thanks!

WhiteBlackGoose commented 1 year ago

It also says "file may be corrupt" in 2/3 of times, even though the app exits with code 0 and the mtuner file is 200mb - 2gb :(

milostosic commented 1 year ago

There are issues with DIA even on Windows and I'm looking at replacing that at some point. Locating the PDB file is 'outsourced' to DIA and that code needs... some improvement :)

I don't know anything about Linux/Wine combo... can't help there.

The "file may be corrupt" implies your captured process didn't exit cleanly and capture file wasn't flushed. It's safe to ignore this.

WhiteBlackGoose commented 1 year ago

Thanks for the quick answer. What can I do on my side to prevent files from corruption?

milostosic commented 1 year ago

The 'corrupted' part is almost certainly the very end of file. You can make sure your process has a clean exit and CRT cleanup so MTuner injected code can flush the remaining collected data. The data is collected in small buffers so even in this case you may not be missing much information.

WhiteBlackGoose commented 1 year ago

Oh. How to "force" load the file then? It doesn't show anything when it fails to load the file with this error

milostosic commented 1 year ago

Ah then it may be a different situation and you'd have to debug this one :/