| 11 | } |
| 12 | |
| 13 | DWORD CCallStackDlg::LoadSymbolsThread() { |
| 14 | auto stack = m_pData->GetStackEventData(); |
| 15 | auto& symbols = SymbolManager::Get(); |
| 16 | auto pid = stack->GetProperty(L"StackProcess")->GetValue<DWORD>(); |
| 17 | |
| 18 | CString num; |
| 19 | for (int i = 1; i <= 192; i++) { |
| 20 | if (m_ExitSymbolThread) |
| 21 | break; |
| 22 | |
| 23 | num.Format(L"Stack%d", i); |
| 24 | auto prop = stack->GetProperty(num); |
| 25 | if (prop == nullptr) |
| 26 | break; |
| 27 | |
| 28 | DWORD64 address; |
| 29 | if (prop->GetLength() == 4) |
| 30 | address = prop->GetValue<DWORD>(); |
| 31 | else |
| 32 | address = prop->GetValue<DWORD64>(); |
| 33 | DWORD64 offset = 0; |
| 34 | auto symbol = symbols.GetSymbolFromAddress(pid, address, &offset); |
| 35 | if (symbol) { |
| 36 | auto sym = symbol->GetSymbolInfo(); |
| 37 | CStringA text; |
| 38 | text.Format("%s!%s+0x%X", symbol->ModuleInfo.ModuleName, sym->Name, (DWORD)offset); |
| 39 | SendMessage(WM_USER + 100, i, (LPARAM)(PCSTR)text); |
| 40 | } |
| 41 | } |
| 42 | SendMessage(WM_USER + 100, 0, 0); |
| 43 | |
| 44 | return 0; |
| 45 | } |
| 46 | |
| 47 | LRESULT CCallStackDlg::OnInitDialog(UINT, WPARAM, LPARAM, BOOL&) { |
| 48 | m_List.Attach(GetDlgItem(IDC_LIST)); |
no test coverage detected