MCPcopy Create free account
hub / github.com/Vector35/debugger / updateIPHighlight

Method updateIPHighlight

ui/ui.cpp:986–1037  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

984
985
986void DebuggerUI::updateIPHighlight()
987{
988 uint64_t lastIP = m_controller->GetLastIP();
989 uint64_t address = m_controller->IP();
990 if (address == lastIP)
991 return;
992
993 BinaryViewRef data = m_controller->GetLiveView();
994 if (!data)
995 return;
996
997 // Remove old instruction pointer highlight
998 for (FunctionRef func : data->GetAnalysisFunctionsContainingAddress(lastIP))
999 {
1000 ModuleNameAndOffset addr;
1001 addr.module = m_controller->GetInputFile();
1002 addr.offset = lastIP - data->GetStart();
1003
1004 BNHighlightStandardColor oldColor = NoHighlightColor;
1005 if (m_controller->ContainsBreakpoint(addr))
1006 oldColor = RedHighlightColor;
1007
1008 func->SetAutoInstructionHighlight(data->GetDefaultArchitecture(), lastIP, oldColor);
1009 for (TagRef tag : func->GetAddressTags(data->GetDefaultArchitecture(), lastIP))
1010 {
1011 if (tag->GetType() != getPCTagType(data))
1012 continue;
1013
1014 func->RemoveUserAddressTag(data->GetDefaultArchitecture(), lastIP, tag);
1015 }
1016 }
1017
1018 // Add new instruction pointer highlight
1019 for (FunctionRef func : data->GetAnalysisFunctionsContainingAddress(address))
1020 {
1021 bool tagFound = false;
1022 for (TagRef tag : func->GetAddressTags(data->GetDefaultArchitecture(), address))
1023 {
1024 if (tag->GetType() == getPCTagType(data))
1025 {
1026 tagFound = true;
1027 break;
1028 }
1029 }
1030
1031 if (!tagFound)
1032 {
1033 func->SetAutoInstructionHighlight(data->GetDefaultArchitecture(), address, BlueHighlightColor);
1034 func->CreateUserAddressTag(data->GetDefaultArchitecture(), address, getPCTagType(data), "program counter");
1035 }
1036 }
1037}
1038
1039
1040void DebuggerUI::navigateToCurrentIP()

Callers

nothing calls this directly

Calls 5

ContainsBreakpointMethod · 0.80
GetLastIPMethod · 0.45
IPMethod · 0.45
GetLiveViewMethod · 0.45
GetInputFileMethod · 0.45

Tested by

no test coverage detected