File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1160,11 +1160,15 @@ void MemoryViewerViewModel::DoFrame()
11601160
11611161 const auto & pMemoryContext = ra::services::ServiceLocator::Get<ra::context::IEmulatorMemoryContext>();
11621162 const auto nToRead = gsl::narrow_cast<size_t >(nVisibleLines) * 16 ;
1163- const auto nRead = m_pInvalid[0 ] ? 0 : pMemoryContext.ReadMemory (nAddress, pMemory, nToRead);
1164- for (auto nOffset = nRead; nOffset < nToRead; nOffset += 16 )
1163+ if (m_pInvalid[0 ] || pMemoryContext.ReadMemory (nAddress, pMemory, nToRead) != nToRead)
11651164 {
1166- if (!m_pInvalid[nOffset])
1167- pMemoryContext.ReadMemory (nAddress + nOffset, &pMemory[nOffset], 16 );
1165+ memset (&pMemory, 0 , sizeof (pMemory));
1166+
1167+ for (auto nOffset = 0 ; nOffset < nToRead; nOffset += 16 )
1168+ {
1169+ if (!m_pInvalid[nOffset])
1170+ pMemoryContext.ReadMemory (nAddress + nOffset, &pMemory[nOffset], 16 );
1171+ }
11681172 }
11691173
11701174 constexpr int nStride = 8 ;
You can’t perform that action at this time.
0 commit comments