Revert r280200 and put it a proper fix
authorPavel Labath <labath@google.com>
Wed, 31 Aug 2016 07:49:37 +0000 (07:49 +0000)
committerPavel Labath <labath@google.com>
Wed, 31 Aug 2016 07:49:37 +0000 (07:49 +0000)
PeekChar returns a character, we want the whole string there.

llvm-svn: 280204

lldb/source/Plugins/Process/Linux/NativeProcessLinux.cpp
lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp

index 49efeb8..17f136c 100644 (file)
@@ -1620,7 +1620,7 @@ ParseMemoryRegionInfoFromProcMapsLine (const std::string &maps_line, MemoryRegio
 {
     memory_region_info.Clear();
 
-    StringExtractor line_extractor (maps_line.c_str ());
+    StringExtractor line_extractor (maps_line);
 
     // Format: {address_start_hex}-{address_end_hex} perms offset  dev   inode   pathname
     // perms: rwxp   (letter is present if set, '-' if not, final character is p=private, s=shared).
@@ -1687,9 +1687,7 @@ ParseMemoryRegionInfoFromProcMapsLine (const std::string &maps_line, MemoryRegio
     line_extractor.GetU64(0, 10);          // Read the inode number
 
     line_extractor.SkipSpaces();
-    const char* name = line_extractor.PeekChar();
-    if (name)
-        memory_region_info.SetName(name);
+    memory_region_info.SetName(line_extractor.Peek().str().c_str());
 
     return Error ();
 }
index 89d5f38..44566c8 100644 (file)
@@ -1257,7 +1257,8 @@ GDBRemoteCommunicationServerLLGS::Handle_c (StringExtractorGDBRemote &packet)
     if (has_continue_address)
     {
         if (log)
-            log->Printf ("GDBRemoteCommunicationServerLLGS::%s not implemented for c{address} variant [%s remains]", __FUNCTION__, packet.Peek ());
+            log->Printf("GDBRemoteCommunicationServerLLGS::%s not implemented for c{address} variant [%s remains]",
+                        __FUNCTION__, packet.Peek().str().c_str());
         return SendUnimplementedResponse (packet.GetStringRef().c_str());
     }