projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
da276f9
)
Change RNBRemote::HandlePacket_m() to store the packet on the heap
author
Jason Molenda
<jmolenda@apple.com>
Tue, 11 Feb 2014 00:48:29 +0000
(
00:48
+0000)
committer
Jason Molenda
<jmolenda@apple.com>
Tue, 11 Feb 2014 00:48:29 +0000
(
00:48
+0000)
instead of on the stack. Handles larger packet read requests better.
llvm-svn: 201118
lldb/tools/debugserver/source/RNBRemote.cpp
patch
|
blob
|
history
diff --git
a/lldb/tools/debugserver/source/RNBRemote.cpp
b/lldb/tools/debugserver/source/RNBRemote.cpp
index
5b32ee1
..
7262d06
100644
(file)
--- a/
lldb/tools/debugserver/source/RNBRemote.cpp
+++ b/
lldb/tools/debugserver/source/RNBRemote.cpp
@@
-2476,7
+2476,11
@@
RNBRemote::HandlePacket_m (const char *p)
return SendPacket ("");
}
- uint8_t buf[length];
+ uint8_t *buf = (uint8_t *)malloc (length);
+ if (buf == NULL)
+ {
+ return SendPacket ("E78");
+ }
int bytes_read = DNBProcessMemoryRead (m_ctx.ProcessID(), addr, length, buf);
if (bytes_read == 0)
{
@@
-2490,6
+2494,7
@@
RNBRemote::HandlePacket_m (const char *p)
std::ostringstream ostrm;
for (int i = 0; i < length; i++)
ostrm << RAWHEX8(buf[i]);
+ free (buf);
return SendPacket (ostrm.str ());
}