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

Method ParseDebugFrameData

IDEHelper/DbgModule.cpp:4534–4605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4532}
4533
4534void DbgModule::ParseDebugFrameData()
4535{
4536 BP_ZONE("ParseDebugFrameData");
4537
4538 const uint8* data = mDebugFrameData;
4539 if (data == NULL)
4540 return;
4541
4542 mParsedFrameDescriptors = true;
4543 Dictionary<addr_target, DwCommonFrameDescriptor*> commonFrameDescriptorMap;
4544
4545 while (true)
4546 {
4547 addr_target relSectionAddr = (addr_target)(data - mDebugFrameData);
4548
4549 int length = GET(int);
4550 if (length == 0)
4551 break;
4552
4553 const uint8* dataEnd = data + length;
4554
4555 int cieID = GET(int);
4556
4557 if (cieID < 0)
4558 {
4559 BP_ALLOC_T(DwCommonFrameDescriptor);
4560 DwCommonFrameDescriptor* commonFrameDescriptor = mAlloc.Alloc<DwCommonFrameDescriptor>();
4561
4562 char version = GET(char);
4563 commonFrameDescriptor->mDbgModule = this;
4564 commonFrameDescriptor->mAugmentation = DataGetString(data);
4565
4566 if (version >= 4)
4567 {
4568 commonFrameDescriptor->mPointerSize = GET(int8);
4569 commonFrameDescriptor->mSegmentSize = GET(int8);
4570 }
4571
4572 commonFrameDescriptor->mCodeAlignmentFactor = (int)DecodeULEB128(data);
4573 commonFrameDescriptor->mDataAlignmentFactor = (int)DecodeSLEB128(data);
4574 commonFrameDescriptor->mReturnAddressColumn = (int)DecodeULEB128(data);
4575 commonFrameDescriptor->mInstData = data;
4576 commonFrameDescriptor->mInstLen = (int)(dataEnd - data);
4577
4578 mDebugTarget->mCommonFrameDescriptors.push_back(commonFrameDescriptor);
4579 if (version < 3)
4580 commonFrameDescriptorMap[relSectionAddr] = commonFrameDescriptor;
4581 else
4582 commonFrameDescriptorMap[mDebugFrameAddress + relSectionAddr] = commonFrameDescriptor;
4583 }
4584 else
4585 {
4586 addr_target lowPC = GET(addr_target);
4587 addr_target highPC = lowPC + GET(addr_target);
4588
4589 DwCommonFrameDescriptor* commonFrameDescriptor = commonFrameDescriptorMap[(addr_target)cieID];
4590
4591 BF_ASSERT(commonFrameDescriptor != NULL);

Callers

nothing calls this directly

Calls 5

DecodeULEB128Function · 0.85
DecodeSLEB128Function · 0.85
DwFrameDescriptorClass · 0.85
DataGetStringFunction · 0.70
push_backMethod · 0.45

Tested by

no test coverage detected