MCPcopy Create free account
hub / github.com/beefytech/Beef / GetStackFrameInfo

Method GetStackFrameInfo

IDEHelper/Compiler/CeDebugger.cpp:4547–4680  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4545}
4546
4547String CeDebugger::GetStackFrameInfo(int stackFrameIdx, intptr* addr, String* outFile, int32* outHotIdx, int32* outDefLineStart, int32* outDefLineEnd, int32* outLine, int32* outColumn, int32* outLanguage, int32* outStackSize, int8* outFlags)
4548{
4549 AutoCrit autoCrit(mDebugManager->mCritSect);
4550
4551 if (!mCeMachine->mDbgPaused)
4552 return "";
4553
4554 UpdateCallStack();
4555
4556 enum FrameFlags
4557 {
4558 FrameFlags_Optimized = 1,
4559 FrameFlags_HasPendingDebugInfo = 2,
4560 FrameFlags_CanGetOldSource = 4,
4561 FrameFlags_WasHotReplaced = 8,
4562 FrameFlags_HadError = 0x10
4563 };
4564
4565 auto ceContext = mCeMachine->mCurContext;
4566
4567 *addr = 0;
4568 *outFile = "";
4569 *outHotIdx = 0;
4570 *outDefLineStart = -1;
4571 *outDefLineEnd = -1;
4572 *outLine = -1;
4573 *outColumn = 0;
4574 *outLanguage = DbgLanguage_Beef;
4575 *outStackSize = 0;
4576 *outFlags = 0;
4577
4578 if (ceContext == NULL)
4579 return "";
4580
4581 auto& dbgCallstackInfo = mDbgCallStack[stackFrameIdx];
4582
4583 if (dbgCallstackInfo.mFrameIdx == -1)
4584 {
4585 if (ceContext->mCurCallSource != NULL)
4586 {
4587 int line = -1;
4588 int lineChar = -1;
4589 auto parserData = ceContext->mCurCallSource->mRefNode->GetParserData();
4590 if (parserData != NULL)
4591 {
4592 parserData->GetLineCharAtIdx(ceContext->mCurCallSource->mRefNode->GetSrcStart(), line, lineChar);
4593 *outLine = line;
4594 *outColumn = lineChar;
4595 *outFile = parserData->mFileName;
4596 }
4597 }
4598
4599 // Entry marker
4600 String result = "const eval";
4601 if (ceContext->mCurCallSource->mKind == CeCallSource::Kind_FieldInit)
4602 {
4603 return String("field init of : ") + ceContext->mCurModule->TypeToString(ceContext->mCurCallSource->mFieldInstance->mOwner) + "." +
4604 ceContext->mCurCallSource->mFieldInstance->GetFieldDef()->mName;

Callers

nothing calls this directly

Calls 9

StringClass · 0.85
GetParserDataMethod · 0.80
GetLineCharAtIdxMethod · 0.80
GetFieldDefMethod · 0.80
MethodToStringMethod · 0.80
FindEmitEntryMethod · 0.80
GetSrcStartMethod · 0.45
TypeToStringMethod · 0.45
ToStringMethod · 0.45

Tested by

no test coverage detected