Fixed an issue where large memory writes might not get chunked up into smaller

packets in GDB remote.

Also fixed a compiler warning for an unhandled case for a switch.

llvm-svn: 131397
This commit is contained in:
Greg Clayton 2011-05-16 02:35:02 +00:00
parent 92e18ed40f
commit b4aaf2e78d
3 changed files with 10 additions and 1 deletions

View File

@ -1520,6 +1520,14 @@ ProcessGDBRemote::DoReadMemory (addr_t addr, void *buf, size_t size, Error &erro
size_t
ProcessGDBRemote::DoWriteMemory (addr_t addr, const void *buf, size_t size, Error &error)
{
if (size > m_max_memory_size)
{
// Keep memory read sizes down to a sane limit. This function will be
// called multiple times in order to complete the task by
// lldb_private::Process so it is ok to do this.
size = m_max_memory_size;
}
StreamString packet;
packet.Printf("M%llx,%zx:", addr, size);
packet.PutBytesAsRawHex8(buf, size, lldb::endian::InlHostByteOrder(), lldb::endian::InlHostByteOrder());

View File

@ -262,6 +262,7 @@ ClangASTType::GetFormat (clang_type_t clang_type)
//default: assert(0 && "Unknown builtin type!");
case clang::BuiltinType::UnknownAny:
case clang::BuiltinType::Void:
case clang::BuiltinType::BoundMember:
break;
case clang::BuiltinType::Bool: return lldb::eFormatBoolean;

View File

@ -1913,7 +1913,7 @@ Process::WriteMemory (addr_t addr, const void *buf, size_t size, Error &error)
BreakpointSiteList::collection::const_iterator end = m_breakpoint_site_list.GetMap()->end();
if (iter == end || iter->second->GetLoadAddress() > addr + size)
return DoWriteMemory(addr, buf, size, error);
return WriteMemoryPrivate (addr, buf, size, error);
BreakpointSiteList::collection::const_iterator pos;
size_t bytes_written = 0;