Commit Graph

337 Commits

Author SHA1 Message Date
Michał Górny 9929cfbcd5 [lldb] [gdb-remote] Use hexadecimal numbers in vFile packats for GDB compliance
Use hexadecimal numbers rather than decimal in various vFile packets
in order to fix compatibility with gdbserver.  This also changes the few
custom LLDB packets -- while technically they do not have to be changed,
it is easier to use the same syntax consistently across LLDB.

Differential Revision: https://reviews.llvm.org/D107475
2021-08-09 12:07:33 +02:00
Michał Górny 8bbef4f9af [lldb] [gdb-remote] Sync vFile:open mode constants with GDB
Sync the mode constants used to drive vFile:open requests with these
used by GDB and defined for the gdb remote protocol.  This makes it
possible to use 'platform file open' after connecting to gdbremote
server (and to some degree to operate on the open file modulo other
incompatibilities).

Differential Revision: https://reviews.llvm.org/D106985
2021-08-09 12:07:18 +02:00
Michał Górny 14735cab65 [lldb] [gdb-remote] Add eOpenOptionReadWrite for future gdb compat
Modify OpenOptions enum to open the future path into synchronizing
vFile:open bits with GDB.  Currently, LLDB and GDB use different flag
models effectively making it impossible to match bits.  Notably, LLDB
uses two bits to indicate read and write status, and uses union of both
for read/write.  GDB uses a value of 0 for read-only, 1 for write-only
and 2 for read/write.

In order to future-proof the code for the GDB variant:

1. Add a distinct eOpenOptionReadWrite constant to be used instead
   of (eOpenOptionRead | eOpenOptionWrite) when R/W access is required.

2. Rename eOpenOptionRead and eOpenOptionWrite to eOpenOptionReadOnly
   and eOpenOptionWriteOnly respectively, to make it clear that they
   do not mean to be combined and require update to all call sites.

3. Use the intersection of all three flags when matching against
   the three possible values.

This commit does not change the actual bits used by LLDB.

Differential Revision: https://reviews.llvm.org/D106984
2021-08-09 12:06:59 +02:00
Walter Erquinigo d52ba48821 [trace] Introduce Hierarchical Trace Representation (HTR) and add command for Intel PT trace visualization
This diff introduces Hierarchical Trace Representation (HTR) and creates the `thread trace export ctf  -f <filename> -t <thread_id>` command to export an Intel PT trace's HTR to Chrome Trace Format (CTF) for visualization.

See `lldb/docs/htr.rst` for context/documentation on HTR.

**Overview of Changes**
    - Add HTR documentation (see `lldb/docs/htr.rst`)
    - Add HTR structures (layer, block, block metadata)
    - Implement "Basic Super Block" HTR pass
    - Add 'thread trace export ctf' command to export the HTR of an Intel PT
      trace to Chrome Trace Format (CTF)

As this diff is the first iteration of HTR and trace visualization, future diffs will build on this work by generalizing the internal design of HTR and implementing new HTR passes that provide better trace summarization/visualization.

See attached video for an example of Intel PT trace visualization:
{F17851042}

Original Author: jj10306

Submitted by: wallace

Reviewed By: wallace, clayborg

Differential Revision: https://reviews.llvm.org/D105741
2021-07-28 13:56:45 -07:00
Muhammad Omair Javaid 4b88a94ebe Revert "[trace] Introduce Hierarchical Trace Representation (HTR) and add command for Intel PT trace visualization"
This reverts commit aad17c55a8.

Breaks LLDB build on 32 bit Arm/Linux bot:
https://lab.llvm.org/buildbot/#/builders/17/builds/9497

Differential Revision: https://reviews.llvm.org/D105741
2021-07-29 01:34:24 +05:00
Walter Erquinigo aad17c55a8 [trace] Introduce Hierarchical Trace Representation (HTR) and add command for Intel PT trace visualization
This diff introduces Hierarchical Trace Representation (HTR) and creates the `thread trace export ctf  -f <filename> -t <thread_id>` command to export an Intel PT trace's HTR to Chrome Trace Format (CTF) for visualization.

See `lldb/docs/htr.rst` for context/documentation on HTR.

**Overview of Changes**
    - Add HTR documentation (see `lldb/docs/htr.rst`)
    - Add HTR structures (layer, block, block metadata)
    - Implement "Basic Super Block" HTR pass
    - Add 'thread trace export ctf' command to export the HTR of an Intel PT
      trace to Chrome Trace Format (CTF)

As this diff is the first iteration of HTR and trace visualization, future diffs will build on this work by generalizing the internal design of HTR and implementing new HTR passes that provide better trace summarization/visualization.

See attached video for an example of Intel PT trace visualization:
{F17851042}

Original Author: jj10306

Submitted by: wallace

Reviewed By: wallace, clayborg

Differential Revision: https://reviews.llvm.org/D105741
2021-07-28 11:04:13 -07:00
Walter Erquinigo 04195843ef [intel pt] Add TSC timestamps
Differential Revision: https://reviews.llvm.org/D106328
2021-07-20 16:29:17 -07:00
Jason Molenda b2e25572d2 Remove the DarwinLog functionality from debguserver
Remove the DarwinLog and qStructuredDataPlugins support
from debugserver.  The DarwinLog plugin was never debugged
fully and made reliable, and the underlying private APIs
it uses have migrated since 2016 so none of them exist
any longer.

Differential Revision: https://reviews.llvm.org/D106324
rdar://75073283
2021-07-20 00:36:56 -07:00
Bruce Mitchener f7d931ac37 [lldb][docs] Remove mention of subversion. NFC.
Reviewed By: DavidSpickett

Differential Revision: https://reviews.llvm.org/D103744
2021-07-14 11:04:07 +00:00
Raphael Isemann 3ebfeb2586 [lldb][docs] Force documentation emission of special Python class members
The current LLDB Python docs are missing documentation for all the special
members such as conversion functions (`__int__`) and other special functions
(`__len__`).

The reason for that is that the `automodapi` plugin we're using to generate the
*.rst files simply doesn't emit them. There doesn't seem to be any config option
to enable those in `automodapi` and it's not even clear why they are filtered. I
assume the leading underscore in their names makes them look like private
methods.

This patch just forcibly adds a few selected special members functions to the
list of functions that sphinx should always document.  This will cause sphinx to
warn if a class doesn't have one of those functions but it's better than not
having them documented.

The main motivation here is that since `SBAddress.__int__` is one of the few
functions that is only available in the embedded Python REPL which would be good
to have in the public documentation.

Fixes rdar://64647665

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D105480
2021-07-07 19:49:50 +02:00
Raphael Isemann 51ab17b91d [lldb][docs] Fix reference warnings in python-reference.rst
References with a single '`' around them are interpreted as references instead
of text with monospaced font since the introduction of the new Python API
generator. This meant that all the single-quoted code in this document that
doesn't reference any Python class was throwing sphinx errors. This just adds
the neede extra ` around this code and fixed up the legitimate typos
(e.g. `SBframe` -> `SBFrame`).
2021-07-06 10:14:33 +02:00
Jason Molenda 9ea6dd5cfa Add a corefile style option to process save-core; skinny corefiles
Add a new feature to process save-core on Darwin systems -- for
lldb to create a user process corefile with only the dirty (modified
memory) pages included.  All of the binaries that were used in the
corefile are assumed to still exist on the system for the duration
of the use of the corefile.  A new --style option to process save-core
is added, so a full corefile can be requested if portability across
systems, or across time, is needed for this corefile.

debugserver can now identify the dirty pages in a memory region
when queried with qMemoryRegionInfo, and the size of vm pages is
given in qHostInfo.

Create a new "all image infos" LC_NOTE for Mach-O which allows us
to describe all of the binaries that were loaded in the process --
load address, UUID, file path, segment load addresses, and optionally
whether code from the binary was executing on any thread.  The old
"read dyld_all_image_infos and then the in-memory Mach-O load
commands to get segment load addresses" no longer works when we
only have dirty memory.

rdar://69670807
Differential Revision: https://reviews.llvm.org/D88387
2021-06-20 12:26:54 -07:00
Walter Erquinigo bf9f21a28b [trace][intel-pt] Create basic SB API
This adds a basic SB API for creating and stopping traces.
Note: This doesn't add any APIs for inspecting individual instructions. That'd be a more complicated change and it might be better to enhande the dump functionality to output the data in binary format. I'll leave that for a later diff.

This also enhances the existing tests so that they test the same flow using both the command interface and the SB API.

I also did some cleanup of legacy code.

Differential Revision: https://reviews.llvm.org/D103500
2021-06-17 15:14:47 -07:00
Raphael Isemann d94ce1a391 [lldb][docs] Add the missing rst anchors to the Python enum docs 2021-06-14 16:31:28 +02:00
Raphael Isemann e3d5e3193f [lldb][docs] Fix section name for InputReaderGranularity 2021-06-14 16:21:40 +02:00
Bruce Mitchener 36597e4719 [lldb] Fix typos. NFC.
Differential Revision: https://reviews.llvm.org/D103381
2021-05-31 06:48:57 +07:00
Raphael Isemann 4112f5ef69 [lldb][NFC] Specify guidelines for API tests
This patch specifies a few guidelines that our API tests should follow.

The motivations for this are twofold:

1. API tests have unexpected pitfalls that especially new contributors run into
when writing tests. To prevent the frustration of letting people figure those
pitfalls out by trial-and-error, let's just document them briefly in one place.

2. It prevents some arguing about what is the right way to write tests. I really
like to have fast and reliable API test suite, but I also don't want to be the
bogeyman that has to insist in every review that the test should be rewritten to
not launch a process for no good reason. It's much easier to just point to a
policy document.

I omitted some guidelines that I think could be controversial (e.g., the whole
"should assert message describe failure or success").

Reviewed By: shafik

Differential Revision: https://reviews.llvm.org/D101153
2021-05-17 11:01:47 +02:00
Brad Smith 3a62d4fde8 Fix typo, arvm7 -> armv7 2021-05-05 00:56:44 -04:00
Michał Górny 6c37984eba [lldb] [gdb-remote server] Introduce new stop reasons for fork and vfork
Introduce three new stop reasons for fork, vfork and vforkdone events.
This includes server support for serializing fork/vfork events into
gdb-remote protocol.  The stop infos for the two base events take a pair
of PID and TID for the newly forked process.

Differential Revision: https://reviews.llvm.org/D100196
2021-04-24 11:08:33 +02:00
Raphael Isemann f3e6f856c2 [lldb][NFC] Remove a stray unicode character in the LLDB test docs
There was a U+2028 character in this line (a special paragraph separator).
2021-04-23 13:20:10 +02:00
Raphael Isemann f8f3fc1fba [lldb][NFC] Delete a checked-in build log in docs/testsuite 2021-04-23 10:36:43 +02:00
Sushma Unnibhavi b68545acf9 [lldb] Improve the documentation (#42017)
Added punctuation and changed "So for instance" to "For instance".

Fixes https://llvm.org/PR42017

Differential revision: https://reviews.llvm.org/D100053
2021-04-08 10:58:02 -07:00
Shafik Yaghmour 79ac5bbb96 [LLDB] Clarifying the documentation for variable formatting wrt to qualifiers and adding a test that demonstrates this
When looking up user specified formatters qualifiers are removed from types before matching,
I have added a clarifying example to the document and added an example to a relevant test to demonstrate this behavior.

Differential Revision: https://reviews.llvm.org/D99827
2021-04-07 14:29:12 -07:00
Dave Lee 0c653d4c3d [lldb] Update test.rst with a paragraph about pdb
Debugging tests sometimes involves debugging the Python source. This adds a paragraph to
the "Debugging Test Failures" section about using `pdb`, and also describes how to run
lldb commands from pdb.

Differential Revision: https://reviews.llvm.org/D99744
2021-04-01 09:53:07 -07:00
Jonas Devlieghere d1828937ed [lldb] Remove references to LLDB_CAPTURE_REPRODUCER
Remove the remaining references to LLDB_CAPTURE_REPRODUCER. I removed
the functionality in an earlier commit but forgot that there was a
corresponding test and logic to unset it in our test suite.
2021-03-31 21:42:00 -07:00
Walter Erquinigo 0b69756110 [trace][intel-pt] Implement trace start and trace stop
This implements the interactive trace start and stop methods.

This diff ended up being much larger than I anticipated because, by doing it, I found that I had implemented in the beginning many things in a non optimal way. In any case, the code is much better now.

There's a lot of boilerplate code due to the gdb-remote protocol, but the main changes are:

- New tracing packets: jLLDBTraceStop, jLLDBTraceStart, jLLDBTraceGetBinaryData. The gdb-remote packet definitions are quite comprehensive.
- Implementation of the "process trace start|stop" and "thread trace start|stop" commands.
- Implementaiton of an API in Trace.h to interact with live traces.
- Created an IntelPTDecoder for live threads, that use the debugger's stop id as checkpoint for its internal cache.
- Added a functionality to stop the process in case "process tracing" is enabled and a new thread can't traced.
- Added tests

I have some ideas to unify the code paths for post mortem and live threads, but I'll do that in another diff.

Differential Revision: https://reviews.llvm.org/D91679
2021-03-30 17:31:37 -07:00
Jan Kratochvil a233d72f0e [lldb/Docs] Update docs with new buildbot URLs 2021-03-17 20:09:03 +01:00
Raphael Isemann 75f97cdafe [lldb] Fix the man page build
In D94489 we changed the way we build the docs and now have some additional
dependencies to generate the Python API docs. As the same sphinx project is
generating the man pages for LLDB it should have in theory the same setup code
that sets up the mocked LLDB module.

However, as we don't have that setup code the man page generation just fails as
there is no mocked LLDB module and the Python API generation errors out.

The man page anyway doesn't cover the Python API so I don't think there is any
point of going through the whole process (and requiring the sphinx plugins) just
to generate the (eventually unused) Python docs.

This patch just skips the relevant Python API generation when we are building
the man page.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D98441
2021-03-11 19:51:47 +01:00
Jonas Devlieghere f46a441b1c [lldb] Extend Python convenience variable table with equivalent APIs
Add a column to the table of convenience variables with the equivalent
API to get to the current debugger, target, process, etc.

We often get asked to make convenience variables available outside of
the interactive interpreter. After explaining why that's not possible, a
common complaint is that it's hard to find out how to get to these
variables in a non-interactive context, for example how to get to the
current frame when given a thread. This patch aims to alleviate that by
including the APIs to navigate between these instances in the table.

Differential revision: https://reviews.llvm.org/D97778
2021-03-02 16:13:55 -08:00
Kazu Hirata 4fd3347d6e [lldb] Fix typos in documentation (NFC) 2021-03-01 23:40:29 -08:00
Med Ismail Bennani 103ad3f907 [lldb/Commands] Fix short option collision for `process launch`
This patch changes the short option used in `CommandOptionsProcessLaunch`
for the `-v|--environment` command option to `-E|--environment`.

The reason for that is, that it collides with the `-v|--structured-data-value`
command option generated by `OptionGroupPythonClassWithDict` that
I'm using in an upcoming patch for the `process launch` command.

The long option `--environment` remains the same.

Differential Review: https://reviews.llvm.org/D95100

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
2021-03-01 21:13:31 +01:00
Harmen Stoppels a54f160b3a Prefer /usr/bin/env xxx over /usr/bin/xxx where xxx = perl, python, awk
Allow users to use a non-system version of perl, python and awk, which is useful
in certain package managers.

Reviewed By: JDevlieghere, MaskRay

Differential Revision: https://reviews.llvm.org/D95119
2021-02-25 11:32:27 +01:00
Michał Górny 7850bb5f2a [lldb] [docs] Update platform support status
Update supported features on FreeBSD, and supported platform list
on FreeBSD, Linux and NetBSD.

Differential Revision: https://reviews.llvm.org/D97114
2021-02-21 21:47:48 +01:00
Martin Storsjö ae14f3fdbf [LLDB] [docs] Update the list of supported architectures on Windows
Differential Revision: https://reviews.llvm.org/D96840
2021-02-21 22:23:55 +02:00
Jim Ingham 483ec136da Use internal_dict everywhere we refer to the python session dict in docs. 2021-02-09 17:48:47 -08:00
Jim Ingham 365b186c24 Add documentation for the extra_args parameter to breakpoint commands.
Differential Revision: https://reviews.llvm.org/D96368
2021-02-09 15:33:36 -08:00
xgupta 94fac81fcc [Branch-Rename] Fix some links
According to the [[ https://foundation.llvm.org/docs/branch-rename/ | status of branch rename ]], the master branch of the LLVM repository is removed on 28 Jan 2021.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D95766
2021-02-01 16:43:21 +05:30
Raphael Isemann 2939d2e1b4 [lldb][docs] Attempt to disable the generated GitHub button on the LLDB website
For unknown reasons the alabaster theme on the docs server is always generating
a GitHub link in the side bar. Beside the privacy problems of having an iframe
to some third-party service, we never configured any GitHub integration so
this button just links to the GitHub main site.

The button generation should be disabled by default, but as that's apparently
not true in the alabaster theme on the server, this patch tries working around
the issue by just explicitly turning off the GitHub integration.
2021-02-01 09:47:39 +01:00
Raphael Isemann b3c260d8fa [lldb][docs] Expand CSS fix for LLDB doc tables
Apparently the sphinx version on the server doesn't place <p> tags in the
table cells, so the previous fix from commit 7fce3b240b
didn't fix the bug for that sphinx version. Just expand the CSS workaround
to all <td> tags.
2021-01-20 10:30:00 +01:00
Raphael Isemann 3c69ff4b03 [lldb][docs] Filter out 'thisown' attribute and inheritance boilerplate
This patch implements a filter that post-processes some of the generated RST sources
of the Python API docs. I mainly want to avoid two things:

1. Filter out all the inheritance boilerplate that just keeps mentioning for
every class that it inherits from the builtin 'object'. There is no inheritance
in the SB API.

2. More importantly, removes the SWIG generated `thisown` attribute from the
public documentation. I don't think we want users to mess with that attribute
and this is probably causing more confusion than it would help anyone. It also
makes the documentation for some smaller classes more verbose than necessary.

This patch just uses the sphinx event for reading source and removes the parts
that we don't want in documentation.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D94967
2021-01-20 09:07:36 +01:00
Raphael Isemann 7fce3b240b [lldb][docs] Remove -webkit-hyphens in table cells so that table widths are correct on Safari
The tables in the new LLDB documentation currently are less wide than their
contents. The reason for that seems to be the `-webkit-hyphens: auto` property
that sphinx is setting for all `p` tags. The `p` tags in the generated Python
documentation seem to trigger some Safari layout issue, so Safari is calculating
the cell width to be smaller than it should be (which ends up looking like this
{F15104344} ).

This patch just sets that property back to the browser default `manual`. Not
sure if that's the proper workaround, but I clicked around on the website with
the changed CSS and nothing looked funny (which is I believe how webdev unit
testing works).

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D94991
2021-01-20 09:05:28 +01:00
Raphael Isemann 2f80995090 [lldb][docs] Update .htaccess to redirect from old SB API documentation to new one
This is mostly SEO so that the new API can take over the old API when people
search for the different SB* classes. Sadly epydoc decided to throw in a -class
prefix behind all the class file names, so we can't just overwrite the old files
with the newly generated ones.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D94900
2021-01-19 18:58:43 +01:00
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
Raphael Isemann a58aceffad [lldb][docs] Use 'any' as the default role in LLDB's sphinx project
sphinx processes text in backticks depending on what 'role' it has (e.g.,
`:code:\`blub\`` -> role is `code`). If no role is provided, the default role is
taken which is right now using the default value of `content`. `content` only
really makes the text cursive which isn't really useful for anything right now.

Sphinx recommends using the `any` role by default [1] as that turns text in
backticks without an explicit roles into some kind of smart reference. If we did
this in LLDB, then we could just reference SB API classes by doing `\`SBValue\``
instead of typing out the rather verbose `:py:class:`/`:py:func:`/... role
before each reference. This would be especially nice when writing the SB API
docs itself as we constantly have to reference other classes.

[1] https://www.sphinx-doc.org/en/master/usage/restructuredtext/roles.html#role-any

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D94899
2021-01-18 19:08:19 +01:00
Raphael Isemann 6e75ee6b65 [lldb][docs] Use inline literals for code/paths instead of rendering it with the default role
Right now we're using the 'content' role as default which will just render
these things as cursive (which isn't really useful for code examples). It also
prevents us from assigning a more useful default role in the future.
2021-01-18 11:10:19 +01:00
Raphael Isemann e7bc6c594b Reland [lldb][docs] Use sphinx instead of epydoc to generate LLDB's Python reference
The build server should now have the missing dependencies.

Original summary:

Currently LLDB uses epydoc to generate the Python API reference for the website.
epydoc however is unmaintained since more than a decade and no longer works with
Python 3. Also whatever setup we had once for generating the documentation on
the website server no longer seems to work, so the current website documentation
has been stale since more than a year.

This patch replaces epydoc with sphinx and its automodapi plugin that can
generate Python API references. LLVM already uses sphinx for the rest of the
documentation, so this way we are more consistent with the rest of LLVM. The
only new dependency is the automodapi plugin for sphinx.

This patch effectively does the following things:
* Remove the epydoc code.
* Make a new dummy Python API page in our website that just calls the Sphinx
  command for generated the API documentation.
* Add a mock _lldb module that is only used when generating the Python API.
 This way we don't have to build all of LLDB to generate the API reference.

Some notes:
* The long list of skips is necessary due to boilerplate functions that SWIG
  is generating. Sadly automodapi is not really scriptable from what I can see,
  so we have to blacklist this stuff manually.
* The .gitignore change because automodapi wants a subfolder of our
  documentation directory to place generated documentation files there. The path
  is also what is used on the website, so we can't really workaround this
  (without copying the whole `docs` dir somewhere else when we build).
* We have to use environment variables to pass our build path to our sphinx
  configuration. Sphinx doesn't support passing variables onto that script.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D94489
2021-01-17 12:13:01 +01:00
Raphael Isemann 9d2053f61a Revert "[lldb][docs] Use sphinx instead of epydoc to generate LLDB's Python reference"
This reverts commit bab121a1b6. It seems the
docs buildbot doesn't have the required Python headers.
2021-01-15 14:07:45 +01:00
Raphael Isemann bab121a1b6 [lldb][docs] Use sphinx instead of epydoc to generate LLDB's Python reference
Currently LLDB uses epydoc to generate the Python API reference for the website.
epydoc however is unmaintained since more than a decade and no longer works with
Python 3. Also whatever setup we had once for generating the documentation on
the website server no longer seems to work, so the current website documentation
has been stale since more than a year.

This patch replaces epydoc with sphinx and its automodapi plugin that can
generate Python API references. LLVM already uses sphinx for the rest of the
documentation, so this way we are more consistent with the rest of LLVM. The
only new dependency is the automodapi plugin for sphinx.

This patch effectively does the following things:
* Remove the epydoc code.
* Make a new dummy Python API page in our website that just calls the Sphinx
  command for generated the API documentation.
* Add a mock _lldb module that is only used when generating the Python API.
 This way we don't have to build all of LLDB to generate the API reference.

Some notes:
* The long list of skips is necessary due to boilerplate functions that SWIG
  is generating. Sadly automodapi is not really scriptable from what I can see,
  so we have to blacklist this stuff manually.
* The .gitignore change because automodapi wants a subfolder of our
  documentation directory to place generated documentation files there. The path
  is also what is used on the website, so we can't really workaround this
  (without copying the whole `docs` dir somewhere else when we build).
* We have to use environment variables to pass our build path to our sphinx
  configuration. Sphinx doesn't support passing variables onto that script.

Reviewed By: JDevlieghere

Differential Revision: https://reviews.llvm.org/D94489
2021-01-15 13:26:42 +01:00
Jonas Devlieghere cb6d53ccdc [lldb] Bump the required SWIG version to 3
Bump the required SWIG version to 3. If my memory serves me well we last
bumped the required SWIG version to 2 for Python 3. At that time SWIG 3
had already been around for a while so everyone I know was already using
that.

It appears that SWIG 3 is the only version that officially supports
C++11 which we're using in the typemap. SWIG 3 was released in 2014 so I
think it's reasonable to make that the minimum required version.

https://bugs.llvm.org/show_bug.cgi?id=48685

Differential revision: https://reviews.llvm.org/D94244
2021-01-08 08:47:21 -08:00
serge-sans-paille 5e31e226b5 Remove Python2 fallback and only advertise Python3 in the doc
Differential Revision: https://www.youtube.com/watch?v=RsL0cipURA0
2020-12-17 15:40:16 +01:00