SetName accepts a StringRef, why not just SetName(line_extractor.Peek())?<br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 31, 2016 at 12:57 AM Pavel Labath via lldb-commits <<a href="mailto:lldb-commits@lists.llvm.org">lldb-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: labath<br>
Date: Wed Aug 31 02:49:37 2016<br>
New Revision: 280204<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=280204&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=280204&view=rev</a><br>
Log:<br>
Revert r280200 and put it a proper fix<br>
<br>
PeekChar returns a character, we want the whole string there.<br>
<br>
Modified:<br>
lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp<br>
lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp<br>
<br>
Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=280204&r1=280203&r2=280204&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=280204&r1=280203&r2=280204&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp (original)<br>
+++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Wed Aug 31 02:49:37 2016<br>
@@ -1620,7 +1620,7 @@ ParseMemoryRegionInfoFromProcMapsLine (c<br>
{<br>
memory_region_info.Clear();<br>
<br>
- StringExtractor line_extractor (maps_line.c_str ());<br>
+ StringExtractor line_extractor (maps_line);<br>
<br>
// Format: {address_start_hex}-{address_end_hex} perms offset dev inode pathname<br>
// perms: rwxp (letter is present if set, '-' if not, final character is p=private, s=shared).<br>
@@ -1687,9 +1687,7 @@ ParseMemoryRegionInfoFromProcMapsLine (c<br>
line_extractor.GetU64(0, 10); // Read the inode number<br>
<br>
line_extractor.SkipSpaces();<br>
- const char* name = line_extractor.PeekChar();<br>
- if (name)<br>
- memory_region_info.SetName(name);<br>
+ memory_region_info.SetName(line_extractor.Peek().str().c_str());<br>
<br>
return Error ();<br>
}<br>
<br>
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=280204&r1=280203&r2=280204&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=280204&r1=280203&r2=280204&view=diff</a><br>
==============================================================================<br>
--- lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp (original)<br>
+++ lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp Wed Aug 31 02:49:37 2016<br>
@@ -1257,7 +1257,8 @@ GDBRemoteCommunicationServerLLGS::Handle<br>
if (has_continue_address)<br>
{<br>
if (log)<br>
- log->Printf ("GDBRemoteCommunicationServerLLGS::%s not implemented for c{address} variant [%s remains]", __FUNCTION__, packet.Peek ());<br>
+ log->Printf("GDBRemoteCommunicationServerLLGS::%s not implemented for c{address} variant [%s remains]",<br>
+ __FUNCTION__, packet.Peek().str().c_str());<br>
return SendUnimplementedResponse (packet.GetStringRef().c_str());<br>
}<br>
<br>
<br>
<br>
_______________________________________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@lists.llvm.org" target="_blank">lldb-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits</a><br>
</blockquote></div>