[Lldb-commits] [PATCH] Delete ScriptInterpreterObject

Greg Clayton clayborg at gmail.com
Mon Mar 16 16:26:27 PDT 2015


Which strings have embedded NULLs??? I don't see any.

> On Mar 16, 2015, at 4:14 PM, Zachary Turner <zturner at google.com> wrote:
> 
> Hi Greg,
> 
> I think I've fixed the remainder of the issues.  The problem this time was that the RegisterData defined in operating_system.py is a string with embedded nulls, and all of PythonString's getters and setters were not written to correctly handle this.  So I changed all of the const char*'s here to be StringRefs (since we specifically need to support strings with embedded nulls).  Here's a run on Linux with my patch applied.
> 
>  zturner at zturner-goobuntu:/usr/local/google_ssd/src/llvm/build/ninja$ bin/lldb
>  (lldb) file a.out
>  Current executable set to 'a.out' (x86_64).
>  (lldb) break set -n main
>  Breakpoint 1: where = a.out`main, address = 0x00000000004004f0
>  (lldb) run
>  Process 1681 launched: '/usr/local/google_ssd/src/llvm/build/ninja/a.out' (x86_64)
>  Process 1681 stopped
>  * thread #1: tid = 1681, 0x00000000004004f0 a.out`main, name = 'a.out', stop reason = breakpoint 1.1
>      frame #0: 0x00000000004004f0 a.out`main
>  a.out`main:
>  ->  0x4004f0 <+0>: int3   
>      0x4004f1 <+1>: movq   %rsp, %rbp
>      0x4004f4 <+4>: movl   $0x0, %eax
>      0x4004f9 <+9>: movl   $0x0, -0x4(%rbp)
>  (lldb) settings set target.process.python-os-plugin-path /usr/local/google_ssd/src/llvm/tools/lldb/examples/python/operating_system.py
>  (lldb) thread list
>  Process 1681 stopped
>  * thread #1: tid = 1681, 0x00000000004004f0 a.out`main, name = 'a.out', stop reason = breakpoint 1.1
>    thread #2: tid = 4581298449, 0x0000000000000011, name = 'one', queue = 'queue1'
>    thread #3: tid = 9162596898, 0x0000000000000075, name = 'two', queue = 'queue2'
>    thread #4: tid = 13743895347, name = 'three', queue = 'queue3'
>  (lldb)
> 
> Note this still doesn't work on Windows because operating_system.py checks the triple and only returns valid information for x86-64, which I haven't added support for yet.  Also, I ran the new test on Linux and it passes.
> 
> 
> http://reviews.llvm.org/D8128
> 
> Files:
>  include/lldb/Core/StructuredData.h
>  include/lldb/DataFormatters/TypeSummary.h
>  include/lldb/DataFormatters/TypeSynthetic.h
>  include/lldb/Interpreter/PythonDataObjects.h
>  include/lldb/Interpreter/ScriptInterpreter.h
>  include/lldb/Interpreter/ScriptInterpreterPython.h
>  include/lldb/Target/ThreadPlanPython.h
>  include/lldb/lldb-forward.h
>  source/Commands/CommandObjectCommands.cpp
>  source/Core/StructuredData.cpp
>  source/DataFormatters/TypeSynthetic.cpp
>  source/Interpreter/PythonDataObjects.cpp
>  source/Interpreter/ScriptInterpreterPython.cpp
>  source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
>  source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
>  source/Plugins/Process/Utility/DynamicRegisterInfo.cpp
>  source/Plugins/Process/Utility/DynamicRegisterInfo.h
>  source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
>  source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
>  source/Target/ThreadPlanPython.cpp
> 
> EMAIL PREFERENCES
>  http://reviews.llvm.org/settings/panel/emailpreferences/
> <D8128.22062.patch>





More information about the lldb-commits mailing list