SBFile is a scripting API wrapper for lldb_private::File
This is the first step in a project to enable arbitrary python
io.IOBase file objects -- including those that override the read()
and write() methods -- to be used as the main debugger IOStreams.
Currently this is impossible because python file objects must first
be converted into FILE* streams by SWIG in order to be passed into
the debugger.
full prototype: https://github.com/smoofra/llvm-project/tree/files
Sorry for being late to the party, but I just stumbled upon this code...
It seems to return a pointer from a view that had just been released. Isn't this kind of risky? While most of the time buffer views point into object's internal memory, buffer protocol does not prohibit allocating memory just to fulfill the buffer request. In which case PyBuffer_Release would be expected to release that memory, leaving the caller with a dangling pointer.