Navigate to the address. This has some special handling of the process which is useful for a debugging scenario. I believe at least some logic should be built into the default navigation behavior.
| 926 | // Navigate to the address. This has some special handling of the process which is useful for a debugging scenario. |
| 927 | // I believe at least some logic should be built into the default navigation behavior. |
| 928 | void DebuggerUI::navigateDebugger(uint64_t address) |
| 929 | { |
| 930 | ViewFrame* frame = m_context->getCurrentViewFrame(); |
| 931 | View* view = m_context->getCurrentView(); |
| 932 | FunctionRef function = view->getCurrentFunction(); |
| 933 | if (function) |
| 934 | { |
| 935 | // If the user is viewing a function in the current View, then navigate the current frame. |
| 936 | frame->navigate(m_controller->GetLiveView(), address, true, true); |
| 937 | } |
| 938 | else |
| 939 | { |
| 940 | // Otherwise, the user is viewing some data. Do not navigate the current SyncGroup. |
| 941 | // Instead, find a SyncGroup which is viewing a function. If none, fallback to navigating in the current frame. |
| 942 | bool navigated = false; |
| 943 | auto fileContext = frame->getFileContext(); |
| 944 | if (fileContext) |
| 945 | { |
| 946 | auto syncGroups = fileContext->allSyncGroups(); |
| 947 | for (const auto& syncGroup : syncGroups) |
| 948 | { |
| 949 | for (auto i : syncGroup->members()) |
| 950 | { |
| 951 | View* groupView = i->getCurrentViewInterface(); |
| 952 | auto data = groupView->getData(); |
| 953 | bool dataMatch = (data && (data == m_controller->GetLiveView() || data == m_controller->GetData())); |
| 954 | if (dataMatch && groupView->getCurrentFunction()) |
| 955 | { |
| 956 | navigated |= i->navigate(m_controller->GetLiveView(), address, true, true); |
| 957 | if (navigated) |
| 958 | break; |
| 959 | } |
| 960 | } |
| 961 | } |
| 962 | } |
| 963 | |
| 964 | if (!navigated) |
| 965 | frame->navigate(m_controller->GetLiveView(), address, true, true); |
| 966 | } |
| 967 | |
| 968 | openDebuggerSideBar(frame); |
| 969 | } |
| 970 | |
| 971 | |
| 972 | void DebuggerUI::openDebuggerSideBar(ViewFrame* frame) |
nothing calls this directly
no test coverage detected