[Lldb-commits] [PATCH] D60968: WIP, RFC: Add an example of how LLDB python plug-in could look like

Greg Clayton via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Apr 22 11:23:45 PDT 2019


clayborg added a comment.

Not sure what functionality this really adds? It seems to just wrap the OS plug-in python class in a different way?



================
Comment at: lldb/examples/python/lldb-os-plugin/arch/arc.py:15
+# Find the location of registers description file.
+_interp = lldb.debugger.GetCommandInterpreter()
+_result = lldb.SBCommandReturnObject()
----------------
We really shouldn't be using the "lldb.debugger" in the script, we would want this to be supplied to a function call. Top level code isn't always a great idea. If you import this module before the process is loaded "plugin.process.icd.hardware.registers" might not be available.


================
Comment at: lldb/examples/python/lldb-os-plugin/core/cvalue.py:1-7
+from typing import Any
+
+from utilities.tracing import traced
+
+import lldb
+
+
----------------
this is already in lldb.value in the lldb module. did you make additions to it? If so, modify that and remove this file


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60968/new/

https://reviews.llvm.org/D60968





More information about the lldb-commits mailing list