diff options
Diffstat (limited to 'sources/shiboken6/doc/shibokenmodule.rst')
-rw-r--r-- | sources/shiboken6/doc/shibokenmodule.rst | 72 |
1 files changed, 70 insertions, 2 deletions
diff --git a/sources/shiboken6/doc/shibokenmodule.rst b/sources/shiboken6/doc/shibokenmodule.rst index 150998ccd..3bc4fa6ba 100644 --- a/sources/shiboken6/doc/shibokenmodule.rst +++ b/sources/shiboken6/doc/shibokenmodule.rst @@ -1,7 +1,9 @@ -.. module:: shiboken +.. module:: Shiboken .. |maya| unicode:: Maya U+2122 +.. _shiboken-module: + Shiboken module *************** @@ -17,6 +19,7 @@ Functions * def :meth:`isOwnedByPython<shiboken.isOwnedByPython>` (obj) * def :meth:`wasCreatedByPython<shiboken.wasCreatedByPython>` (obj) * def :meth:`dump<shiboken.dump>` (obj) + * def :meth:`disassembleFrame<shiboken.disassembleFrame>` (marker) Detailed description ^^^^^^^^^^^^^^^^^^^^ @@ -29,6 +32,11 @@ or just for debug purposes. Some function description refer to "Shiboken based objects", wich means Python objects instances of any Python Type created using Shiboken. +To import the module: + +.. code-block:: python + + from shiboken6 import Shiboken .. function:: isValid(obj) @@ -76,4 +84,64 @@ Python objects instances of any Python Type created using Shiboken. creating their own bindings as no guarantee is provided that the string format will be the same across different versions. - If the object is not a Shiboken based object, a TypeError is thrown. + If the object is not a Shiboken based object, a message is printed. + +.. function:: disassembleFrame(label) + + Prints the current executing Python frame to stdout and flushes. + The disassembly is decorated by some label. Example: + + .. code-block:: python + + lambda: 42 + + is shown from inside C++ as + + .. code-block:: c + + <label> BEGIN + 1 0 LOAD_CONST 1 (42) + 2 RETURN_VALUE + <label> END + + When you want to set a breakpoint at the `disassembleFrame` function + and you use it from C++, you use the pure function name. + + When you want to use it from Python, you can insert it into your Python + code and then maybe instead set a breakpoint at `SbkShibokenModule_disassembleFrame` + which is the generated wrapper. + + `label` is a simple string in C++. In Python, you can use any object; + internally the `str` function is called with it. + + This method should be used **only** for debug purposes by developers. + + .. function:: dumpTypeGraph(file_name) + + Dumps the inheritance graph of the types existing in libshiboken + to ``.dot`` file for use with `Graphviz <https://graphviz.org/>`_. + +.. function:: dumpWrapperMap() + + Dumps the map of wrappers existing in libshiboken to standard error. + +.. function:: dumpConverters() + + Dumps the map of named converters existing in libshiboken to standard + error. + + .. py:class:: VoidPtr(address, size = -1, writeable = 0) + + :param address: (PyBuffer, SbkObject, int, VoidPtr) + :param size: int + :param writeable: int + + Represents a chunk of memory by address and size and implements the ``buffer`` protocol. + It can be constructed from a ``buffer``, a Shiboken based object, a memory address + or another VoidPtr instance. + + .. py:method:: toBytes() + + :rtype: bytes + + Returns the contents as ``bytes``. |