[Lldb-commits] [PATCH] D68737: SBFile::GetFile: convert SBFile back into python native files.

Lawrence D'Anna via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Thu Oct 10 12:47:03 PDT 2019


lawrence_danna marked an inline comment as done.
lawrence_danna added inline comments.


================
Comment at: lldb/include/lldb/Host/File.h:316
+  ///    The PyObject* that this File wraps, or NULL.
+  virtual void *GetPythonObject() const;
+
----------------
labath wrote:
> We've spend a lot of time removing python from the lowest layers, and this let's it back in through the back door. It would be way better to add support for llvm-style rtti to this class, so that the python code can `dyn_cast` to a `PythonFile` when it needs to (re)construct the python object. You can take a look at CPPLanguageRuntime::classof  (and friend) for how to implement this in a plugin-friendly manner.
Ah, thanks.  I orginally wrote this using `dyn_cast` but I found myself putting classnames of python things in an enum in `File.h`, so I thought "what's the point?" -- and I converted it to just using the virtual method.   The `static char ID` trick is nice.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D68737





More information about the lldb-commits mailing list