| 11689 | } |
| 11690 | |
| 11691 | String WinDebugger::GetStackFrameInfo(int stackFrameIdx, intptr* addr, String* outFile, int* outHotIdx, int* outDefLineStart, int* outDefLineEnd, |
| 11692 | int* outLine, int* outColumn, int* outLanguage, int* outStackSize, int8* outFlags) |
| 11693 | { |
| 11694 | enum FrameFlags |
| 11695 | { |
| 11696 | FrameFlags_Optimized = 1, |
| 11697 | FrameFlags_HasPendingDebugInfo = 2, |
| 11698 | FrameFlags_CanGetOldSource = 4, |
| 11699 | FrameFlags_WasHotReplaced = 8, |
| 11700 | FrameFlags_HadError = 0x10 |
| 11701 | }; |
| 11702 | |
| 11703 | AutoCrit autoCrit(mDebugManager->mCritSect); |
| 11704 | |
| 11705 | if (mCallStack.size() == 0) |
| 11706 | UpdateCallStack(); |
| 11707 | |
| 11708 | *addr = 0; |
| 11709 | *outFile = ""; |
| 11710 | *outHotIdx = 0; |
| 11711 | *outDefLineStart = -1; |
| 11712 | *outDefLineEnd = -1; |
| 11713 | *outLine = -1; |
| 11714 | *outColumn = 0; |
| 11715 | *outLanguage = 0; |
| 11716 | *outStackSize = 0; |
| 11717 | *outFlags = 0; |
| 11718 | |
| 11719 | UpdateCallStackMethod(stackFrameIdx); |
| 11720 | |
| 11721 | if (stackFrameIdx >= mCallStack.size()) |
| 11722 | { |
| 11723 | return ""; |
| 11724 | } |
| 11725 | |
| 11726 | int actualStackFrameIdx = BF_MAX(0, stackFrameIdx); |
| 11727 | |
| 11728 | UpdateCallStackMethod(actualStackFrameIdx); |
| 11729 | WdStackFrame* wdStackFrame = mCallStack[actualStackFrameIdx]; |
| 11730 | |
| 11731 | addr_target pcAddress = (addr_target)wdStackFrame->mRegisters.GetPC(); |
| 11732 | if (stackFrameIdx == -1) |
| 11733 | pcAddress = mShowPCOverride; |
| 11734 | |
| 11735 | *addr = pcAddress; |
| 11736 | |
| 11737 | if (actualStackFrameIdx < (int)mCallStack.size() - 2) |
| 11738 | { |
| 11739 | WdStackFrame* prevStackFrame = mCallStack[actualStackFrameIdx + 1]; |
| 11740 | // Inlined methods have no stack frame |
| 11741 | *outStackSize = prevStackFrame->mRegisters.GetSP() - wdStackFrame->mRegisters.GetSP(); |
| 11742 | } |
| 11743 | |
| 11744 | const auto& _CheckHashSrcFile = [&](String& outStr, DbgModule* dbgModule, DbgSrcFile* srcFile) |
| 11745 | { |
| 11746 | if (srcFile->mHashKind != DbgHashKind_None) |
| 11747 | { |
| 11748 | outStr += "#"; |
no test coverage detected