Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/MIDebugEngine/Engine.Impl/DebuggedProcess.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2121,6 +2121,18 @@ internal async Task<uint> ReadProcessMemory(ulong address, uint count, byte[] by

internal async Task<Tuple<ulong, ulong>> FindValidMemoryRange(ulong address, uint count, int offset)
{
// Debugging coredump with LLDB doesn't work well with '-data-read-memory-bytes', the function
// returns an error. Namely 'LLDB unable to read entire memory block of n bytes at address 0x0....'.
// As a result we have to skip calling '-data-read-memory-bytes' and just use the address + offet and count
// in order to get the memory range.
if (IsCoreDump && _launchOptions.DebuggerMIMode == MIMode.Lldb)
{
ulong startAddress = (ulong)((long)address + offset);
ulong endAddress = startAddress + count;

return new Tuple<ulong, ulong>(startAddress, endAddress);
}

var ret = new Tuple<ulong, ulong>(0, 0); // init to an empty range
string cmd = String.Format(CultureInfo.InvariantCulture, "-data-read-memory-bytes -o {0} {1} {2}", offset.ToString(CultureInfo.InvariantCulture), EngineUtils.AsAddr(address, Is64BitArch), count.ToString(CultureInfo.InvariantCulture));
Results results = await CmdAsync(cmd, ResultClass.None);
Expand Down