llvm-capstone/lldb/bindings
Raphael Isemann 3cae8b3329 [lldb][docs] Add a doc page for enums and constants
Enums and constants are currently missing in the new LLDB Python API docs.

In theory we could just let them be autogenerated like the SB API classes, but sadly the generated documentation
suffers from a bunch of problems. Most of these problems come from the way SWIG is representing enums, which is
done by translating every single enum case into its own constant. This has a bunch of nasty effects:

* Because SWIG throws away the enum types, we can't actually reference the enum type itself in the API. Also because automodapi is impossible to script, this can't be fixed in post (at least without running like sed over the output files).
* The lack of enum types also causes that every enum *case* has its own full doc page. Having a full doc page that just shows a single enum case is pointless and it really slows down sphinx.
* There is no SWIG code for the enums, so there is also no place to write documentation strings for them. Also there is no support for copying the doxygen strings (which would be in the wrong format, but better than nothing) for enums (let alone our defines), so we can't really document all this code.
* Because the enum cases are just forwards to the native lldb module (which we mock), automodapi actually takes the `Mock` docstrings and adds it to every single enum case.

I don't see any way to solve this via automodapi or SWIG. The most reasonable way to solve this is IMHO to write a simple Clang tool
that just parses our enum/constant headers and emits an *.rst file that we check in. This way we can do all the LLDB-specific enum case and constant
grouping that we need to make a readable documentation page.

As we're without any real documentation until I get around to write that tool, I wrote a doc page for the enums/constants as a stop gap measure.
Most of this is done by just grepping our enum header and then manually cleaning up all the artifacts and copying the few doc strings we have.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D94959
2021-01-19 18:54:05 +01:00
..
interface [lldb][docs] Add a doc page for enums and constants 2021-01-19 18:54:05 +01:00
lua [LLDB/Lua] add support for one-liner breakpoint callback 2020-11-30 14:12:26 +00:00
python [lldb][docs] Add a doc page for enums and constants 2021-01-19 18:54:05 +01:00
CMakeLists.txt [lldb/CMake] Separate CMake code for Lua and Python (NFC) 2020-08-11 09:04:18 -07:00
headers.swig [lldb/API] Move SBCommandInterpreterRunOption in its own header. (NFC) 2020-04-30 13:41:21 -07:00
interfaces.swig [lldb/API] Move SBCommandInterpreterRunOption in its own header. (NFC) 2020-04-30 13:41:21 -07:00
macros.swig [lldb] Remove nothreadallow from SWIG's __str__ wrappers to work around a Python>=3.7 crash 2020-09-28 10:10:34 +02:00