[Lldb-commits] [lldb] r280204 - Revert r280200 and put it a proper fix

Pavel Labath via lldb-commits lldb-commits at lists.llvm.org
Wed Aug 31 06:30:52 PDT 2016


It's MemoryRegionInfo::SetName(const char *), there's no StringRef
version. I wanted to keep the fix minimal, but it turned out to not be
enough.

On 31 August 2016 at 14:21, Zachary Turner <zturner at google.com> wrote:
> SetName accepts a StringRef, why not just SetName(line_extractor.Peek())?
>
> On Wed, Aug 31, 2016 at 12:57 AM Pavel Labath via lldb-commits
> <lldb-commits at lists.llvm.org> wrote:
>>
>> Author: labath
>> Date: Wed Aug 31 02:49:37 2016
>> New Revision: 280204
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=280204&view=rev
>> Log:
>> Revert r280200 and put it a proper fix
>>
>> PeekChar returns a character, we want the whole string there.
>>
>> Modified:
>>     lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
>>
>> lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
>>
>> Modified: lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp?rev=280204&r1=280203&r2=280204&view=diff
>>
>> ==============================================================================
>> --- lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp
>> (original)
>> +++ lldb/trunk/source/Plugins/Process/Linux/NativeProcessLinux.cpp Wed Aug
>> 31 02:49:37 2016
>> @@ -1620,7 +1620,7 @@ ParseMemoryRegionInfoFromProcMapsLine (c
>>  {
>>      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 (c
>>      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 ();
>>  }
>>
>> Modified:
>> lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp?rev=280204&r1=280203&r2=280204&view=diff
>>
>> ==============================================================================
>> ---
>> lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
>> (original)
>> +++
>> lldb/trunk/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.cpp
>> Wed Aug 31 02:49:37 2016
>> @@ -1257,7 +1257,8 @@ GDBRemoteCommunicationServerLLGS::Handle
>>      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());
>>      }
>>
>>
>>
>> _______________________________________________
>> lldb-commits mailing list
>> lldb-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


More information about the lldb-commits mailing list