[all-commits] [llvm/llvm-project] 738af7: Add the ability to pass extra args to a Python...

jimingham via All-commits all-commits at lists.llvm.org
Fri Oct 25 14:05:23 PDT 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 738af7a6241c98164625b9cd1ba9f8af4e36f197
      https://github.com/llvm/llvm-project/commit/738af7a6241c98164625b9cd1ba9f8af4e36f197
  Author: Jim Ingham <jingham at apple.com>
  Date:   2019-10-25 (Fri, 25 Oct 2019)

  Changed paths:
    M lldb/include/lldb/API/SBBreakpoint.h
    M lldb/include/lldb/API/SBBreakpointLocation.h
    M lldb/include/lldb/API/SBBreakpointName.h
    M lldb/include/lldb/API/SBStructuredData.h
    M lldb/include/lldb/Interpreter/OptionGroupPythonClassWithDict.h
    M lldb/include/lldb/Interpreter/ScriptInterpreter.h
    M lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommand.py
    M lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/TestBreakpointCommandsFromPython.py
    M lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_command/bktptcmd.py
    M lldb/scripts/Python/python-wrapper.swig
    M lldb/scripts/interface/SBBreakpoint.i
    M lldb/scripts/interface/SBBreakpointLocation.i
    M lldb/scripts/interface/SBBreakpointName.i
    M lldb/source/API/SBBreakpoint.cpp
    M lldb/source/API/SBBreakpointLocation.cpp
    M lldb/source/API/SBBreakpointName.cpp
    M lldb/source/Commands/CommandObjectBreakpoint.cpp
    M lldb/source/Commands/CommandObjectBreakpointCommand.cpp
    M lldb/source/Commands/CommandObjectThread.cpp
    M lldb/source/Commands/Options.td
    M lldb/source/Interpreter/OptionGroupPythonClassWithDict.cpp
    M lldb/source/Interpreter/ScriptInterpreter.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
    M lldb/unittests/ScriptInterpreter/Python/PythonTestSuite.cpp

  Log Message:
  -----------
      Add the ability to pass extra args to a Python breakpoint callback.

    For example, it is pretty easy to write a breakpoint command that implements "stop when my caller is Foo", and
    it is pretty easy to write a breakpoint command that implements "stop when my caller is Bar". But there's no
    way to write a generic "stop when my caller is..." function, and then specify the caller when you add the
    command to a breakpoint.

    With this patch, you can pass this data in a SBStructuredData dictionary. That will get stored in
    the PythonCommandBaton for the breakpoint, and passed to the implementation function (if it has the right
    signature) when the breakpoint is hit. Then in lldb, you can say:

    (lldb) break com add -F caller_is -k caller_name -v Foo

    More generally this will allow us to write reusable Python breakpoint commands.

    Differential Revision: https://reviews.llvm.org/D68671




More information about the All-commits mailing list