Skip to content

Commit

Permalink
Document how to build cocotb in development mode
Browse files Browse the repository at this point in the history
Users have expressed problems when trying to debug cocotb code because
binaries (wheels) from PyPi are stripped. Describe (one way) how to get
binaries with debug symbols.
  • Loading branch information
imphil committed May 26, 2023
1 parent 64421b6 commit 3f4e596
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions documentation/source/troubleshooting.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,26 @@ If things fail from within Python, or coroutines aren't being called when you ex
:envvar:`COCOTB_SCHEDULER_DEBUG` variable can be used to (greatly) increase the verbosity of the scheduler.


Building cocotb In Development Mode
===================================

By default cocotb binaries installed from PyPi are stripped, i.e. they do not contain debug symbols.
Rebuilding cocotb from source can add this information back, making it significantly easier to debug cocotb code.
In the following, we'll assume the use of a Linux machine for debugging cocotb, which simplifies the process significantly.

First, install all build requirements as listed at :ref:`install-devel`.

Then execute the following commands to download a development version of cocotb and prepare a shell environment with this a development build of cocotb available:

.. code-block:: shell-session
$ # Obtain the latest development version of cocotb through git
$ git clone https://github.com/cocotb/cocotb.git
$ # Build cocotb in debug mode, and enter a bash shell
$ cd cocotb
$ nox -s dev -- /bin/bash
.. _troubleshooting-attaching-debugger:

Attaching a Debugger
Expand Down

0 comments on commit 3f4e596

Please sign in to comment.