| 10 | USING_NS_BF; |
| 11 | |
| 12 | MiniDumpDebugger::MiniDumpDebugger(DebugManager* debugManager, DbgMiniDump* miniDump) : WinDebugger(debugManager) |
| 13 | { |
| 14 | mMiniDump = miniDump; |
| 15 | mRunState = RunState_Paused; |
| 16 | mExceptionThread = NULL; |
| 17 | mExceptionContextRVA = 0; |
| 18 | |
| 19 | mDebugTarget = new DebugTarget(this); |
| 20 | |
| 21 | for (auto section : mMiniDump->mDirectory) |
| 22 | { |
| 23 | if (section.mStreamType == ThreadExListStream) |
| 24 | { |
| 25 | auto& threadEx = mMiniDump->GetStreamData<MINIDUMP_THREAD_EX_LIST>(section); |
| 26 | |
| 27 | /*WdThreadInfo* threadInfo = new WdThreadInfo(); |
| 28 | threadInfo->mThreadId = threadEx.ThreadId; |
| 29 | mThreadList.Add(threadInfo); |
| 30 | |
| 31 | if (mActiveThread == NULL) |
| 32 | { |
| 33 | mActiveThread = threadInfo; |
| 34 | mDebuggerWaitingThread = threadInfo; |
| 35 | } |
| 36 | |
| 37 | mThreadMap[threadInfo->mThreadId] = threadInfo;*/ |
| 38 | } |
| 39 | else if (section.mStreamType == ModuleListStream) |
| 40 | { |
| 41 | auto& moduleList = mMiniDump->GetStreamData<MINIDUMP_MODULE_LIST>(section); |
| 42 | for (int moduleIdx = 0; moduleIdx < (int)moduleList.NumberOfModules; moduleIdx++) |
| 43 | { |
| 44 | auto& module = moduleList.Modules[moduleIdx]; |
| 45 | COFF* dbgModule = new COFF(mDebugTarget); |
| 46 | if (mDebugTarget->mTargetBinary == NULL) |
| 47 | { |
| 48 | mDebugTarget->mLaunchBinary = dbgModule; |
| 49 | mDebugTarget->mTargetBinary = dbgModule; |
| 50 | } |
| 51 | dbgModule->mImageBase = module.BaseOfImage; |
| 52 | dbgModule->mImageSize = module.SizeOfImage; |
| 53 | |
| 54 | //TODO: 'get' the actual image |
| 55 | dbgModule->mTimeStamp = module.TimeDateStamp; |
| 56 | //dbgModule->mExpectedFileSize = module.; |
| 57 | |
| 58 | const wchar_t* moduleName = &mMiniDump->GetData<wchar_t>(module.ModuleNameRva + 4); |
| 59 | dbgModule->mFilePath = UTF8Encode(moduleName); |
| 60 | dbgModule->mDisplayName = GetFileName(dbgModule->mFilePath); |
| 61 | |
| 62 | struct _CodeViewEntry |
| 63 | { |
| 64 | public: |
| 65 | int32 mSig; |
| 66 | uint8 mGUID[16]; |
| 67 | int32 mAge; |
| 68 | const char mPDBPath[1]; |
| 69 | }; |
nothing calls this directly
no test coverage detected