| 25 | |
| 26 | |
| 27 | DebugProcessView::DebugProcessView(DebugNullView* nullView, BinaryView* parent): |
| 28 | BinaryView("Debugger", parent->GetFile(), nullView) |
| 29 | { |
| 30 | m_arch = parent->GetDefaultArchitecture(); |
| 31 | m_platform = parent->GetDefaultPlatform(); |
| 32 | m_addressSize = parent->GetAddressSize(); |
| 33 | auto bits = m_addressSize * 8; |
| 34 | if (bits >= 64) |
| 35 | m_length = UINT64_MAX; |
| 36 | else |
| 37 | m_length = (1ULL << bits) - 1; |
| 38 | |
| 39 | m_endian = parent->GetDefaultEndianness(); |
| 40 | |
| 41 | // TODO: Read segments from debugger |
| 42 | uint64_t length = PerformGetLength(); |
| 43 | // If we do not add any segments, BN will malfunction. If we add a binary view that is large, e.g., 0xffffffff, |
| 44 | // it will be truncated to the size of the parent view. And the region from 0x0 to the size of the parent view will |
| 45 | // be unreadable, because BN will try to read the byte values from the parent view, rather from the debug process |
| 46 | // view, which eventually reads from the debug adapter backend. So, as a workaround, we add a segment that has size |
| 47 | // 0x1, which minimizes the unreadable regions. |
| 48 | // See https://github.com/Vector35/debugger/issues/334 for more details. |
| 49 | AddAutoSegment(0, 1, 0, 1, SegmentReadable | SegmentWritable | SegmentExecutable); |
| 50 | AddAutoSection("Memory", 0, length); |
| 51 | |
| 52 | m_aggressiveAnalysisUpdate = Settings::Instance()->Get<bool>("debugger.aggressiveAnalysisUpdate"); |
| 53 | |
| 54 | m_controller = DebuggerController::GetController(parent); |
| 55 | m_eventCallback = m_controller->RegisterEventCallback([this](const DebuggerEvent& event){ |
| 56 | eventHandler(event); |
| 57 | }, "Process View"); |
| 58 | } |
| 59 | |
| 60 | |
| 61 | DebugProcessView::~DebugProcessView() |
nothing calls this directly
no test coverage detected