Skip to content

Commit 8b14000

Browse files
fixup! address review comments
1 parent a0a13a6 commit 8b14000

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2795,14 +2795,20 @@ size_t ProcessGDBRemote::DoReadMemory(addr_t addr, void *buf, size_t size,
27952795
static uint64_t ComputeNumRangesMultiMemRead(
27962796
uint64_t max_packet_size,
27972797
llvm::ArrayRef<Range<lldb::addr_t, size_t>> ranges) {
2798-
// Each range is specified by two numbers (~16 ASCII characters) and one
2798+
// Each range is specified by two numbers (up to 16 ASCII characters) and one
27992799
// comma.
28002800
constexpr uint64_t range_overhead = 33;
28012801
uint64_t current_size = 0;
28022802
for (auto [idx, range] : llvm::enumerate(ranges)) {
28032803
uint64_t potential_size = current_size + range.size + range_overhead;
2804-
if (potential_size > max_packet_size)
2804+
if (potential_size > max_packet_size) {
2805+
if (idx == 0)
2806+
LLDB_LOG(GetLog(GDBRLog::Process),
2807+
"MultiMemRead input has a range (base = {0:x}, size = {1}) "
2808+
"bigger than the maximum allowed by remote",
2809+
range.base, range.size);
28052810
return idx;
2811+
}
28062812
}
28072813
return ranges.size();
28082814
}
@@ -2821,9 +2827,6 @@ ProcessGDBRemote::ReadMemoryRanges(
28212827
uint64_t num_ranges =
28222828
ComputeNumRangesMultiMemRead(m_max_memory_size, ranges);
28232829
if (num_ranges == 0) {
2824-
LLDB_LOG(
2825-
GetLog(GDBRLog::Process),
2826-
"MultiMemRead has a range bigger than maximum allowed by remote");
28272830
return Process::ReadMemoryRanges(original_ranges, buffer);
28282831
}
28292832

0 commit comments

Comments
 (0)