Skip to content

Add debug documentation #93

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/source/UsingXeus-Cpp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,3 @@ Using xeus-cpp
xeus-cpp. Thereby you can write and execute C++ code interactively in
this environment.

- Jupyter notebooks support magic commands (**%%python**) and inline code
execution for different languages. We use these features to run Python and C++
code in separate cells to achieve interactive communication between them.

35 changes: 35 additions & 0 deletions docs/source/debug.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Debugging and Testing
--------------------

Debugging
========================

These steps are performed using the GNU Debugger (GDB), so ensure it is installed in your environment. Then execute the command to build the project.

.. code-block:: bash

cmake -D CMAKE_BUILD_TYPE=Debug ..

In the same folder, run the command and copy the JSON displayed in the terminal.

.. code-block:: bash

xcpp

Save the JSON in a new file in any folder. Before proceeding to the next step, ensure that Jupyter Console is installed in the environment. Open a new terminal and run the command in the folder where the JSON file is located.

.. code-block:: bash

jupyter console --existing yourJSONFile.json

Open a new terminal, navigate to the build directory, and run GDB to start debugging.

.. code-block:: bash

gdb xcpp


Testing
========================

The testing code for the source files is located in `test/test_interpreter.cpp`. Write the necessary tests and build the project as described in the repository's README or contributing guidelines. Then, execute `build/test/test_xeus_cpp` to verify if the tests were successful.
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The Xeus-Cpp is a Jupyter kernel for the C++ programming language
UsingXeus-Cpp
tutorials
dev-build-options
debug
FAQ
reference

Expand Down