[all-commits] [llvm/llvm-project] c30742: [lldb/Plugins] Clean-up ScriptedProcess python scr...

Med Ismail Bennani via All-commits all-commits at lists.llvm.org
Wed Feb 16 11:45:18 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c30742ba73816ca61926121c82b81a766ebe1a6e
      https://github.com/llvm/llvm-project/commit/c30742ba73816ca61926121c82b81a766ebe1a6e
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-02-16 (Wed, 16 Feb 2022)

  Changed paths:
    R lldb/examples/python/scripted_process/my_scripted_process.py
    M lldb/examples/python/scripted_process/scripted_process.py

  Log Message:
  -----------
  [lldb/Plugins] Clean-up ScriptedProcess python script (NFC)

This patch removes the `my_scripted_process.py` blueprint since it's not
used anymore.

The patch also updates the base ScriptedProcess and ScriptedThread
initializers to automatically initialize convinience variables, to
access debugger from the ScriptedProcess, access the SBProcess and
ScriptedProcess object from a ScriptedThread instance.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 70665844915eeb66273a84f131ffc33a202539d5
      https://github.com/llvm/llvm-project/commit/70665844915eeb66273a84f131ffc33a202539d5
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-02-16 (Wed, 16 Feb 2022)

  Changed paths:
    M lldb/examples/python/scripted_process/scripted_process.py
    M lldb/include/lldb/Target/StackFrameList.h
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
    M lldb/source/Plugins/Process/scripted/ScriptedThread.cpp
    M lldb/source/Plugins/Process/scripted/ScriptedThread.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.cpp
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h
    M lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp
    M lldb/test/API/functionalities/scripted_process/TestScriptedProcess.py
    M lldb/test/API/functionalities/scripted_process/dummy_scripted_process.py
    M lldb/test/API/functionalities/scripted_process/invalid_scripted_process.py
    M lldb/test/API/functionalities/scripted_process/stack_core_scripted_process.py

  Log Message:
  -----------
  [lldb/Plugin] Add artificial stackframe loading in ScriptedThread

This patch adds the ability for ScriptedThread to load artificial stack
frames. To do so, the interpreter instance can create a list that will
contain the frame index and its pc address.

Then, when the Scripted Process plugin stops, it will refresh its
Scripted Threads state by invalidating their register context and load
to list from the interpreter object and reconstruct each frame.

This patch also removes all of the default implementation for
`get_stackframes` from the derived ScriptedThread classes, and add the
interface code for the Scripted Thread Interface.

rdar://88721095

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 7f3fc2eee8ff13f6922a16331870fc57cd022773
      https://github.com/llvm/llvm-project/commit/7f3fc2eee8ff13f6922a16331870fc57cd022773
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-02-16 (Wed, 16 Feb 2022)

  Changed paths:
    M lldb/bindings/interface/SBCommandInterpreter.i
    M lldb/include/lldb/API/SBCommandInterpreter.h
    M lldb/include/lldb/Interpreter/CommandInterpreter.h
    M lldb/source/API/SBCommandInterpreter.cpp
    M lldb/source/Interpreter/CommandInterpreter.cpp

  Log Message:
  -----------
  [lldb/API] Add a way to check if the CommandInterpreter is interactive

This patch adds the ability for the user to check if the command
interpreter's IOHandler is interactive.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 7c54ffdc6c2e55565344a8d6200f63ee016891a9
      https://github.com/llvm/llvm-project/commit/7c54ffdc6c2e55565344a8d6200f63ee016891a9
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-02-16 (Wed, 16 Feb 2022)

  Changed paths:
    M lldb/bindings/python/CMakeLists.txt
    M lldb/examples/python/crashlog.py
    A lldb/examples/python/scripted_process/crashlog_scripted_process.py
    M lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp
    A lldb/test/Shell/ScriptInterpreter/Python/Crashlog/Inputs/scripted_crashlog.ips
    A lldb/test/Shell/ScriptInterpreter/Python/Crashlog/scripted_crashlog_json.test

  Log Message:
  -----------
  [lldb/crashlog] Add CrashLogScriptedProcess & remove interactive mode

This patch introduces a new type of ScriptedProcess: CrashLogScriptedProcess.
It takes advantage of lldb's crashlog parsers and Scripted Processes to
reconstruct a static debugging session with symbolicated stackframes, instead
of just dumping out everything in the user's terminal.

The crashlog command also has an interactive mode that only provide a
very limited experience. This is why this patch removes all the logic
for this interactive mode and creates CrashLogScriptedProcess instead.

This will fetch and load all the libraries that were used by the crashed
thread and re-create all the frames artificially.

rdar://88721117

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


  Commit: 21658b77a5965217eb67f8e1ccd4307111c775f7
      https://github.com/llvm/llvm-project/commit/21658b77a5965217eb67f8e1ccd4307111c775f7
  Author: Med Ismail Bennani <medismail.bennani at gmail.com>
  Date:   2022-02-16 (Wed, 16 Feb 2022)

  Changed paths:
    M lldb/examples/python/crashlog.py

  Log Message:
  -----------
  [lldb/crashlog] Fix exception signal parsing

In some cases, it can happen that crashlogs don't have any signal in
the exception, which causes the parser to crash.

This fixes the parsing by checking if the `signal` field is in the
`exception` dictionary before trying to access it.

rdar://84552251

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

Signed-off-by: Med Ismail Bennani <medismail.bennani at gmail.com>


Compare: https://github.com/llvm/llvm-project/compare/6d58f4ab071e...21658b77a596


More information about the All-commits mailing list