Skip to content

Commit 94556cf

Browse files
authored
Add debug documentation (#93)
Fixes #7
1 parent cd317b2 commit 94556cf

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed

docs/source/UsingXeus-Cpp.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,3 @@ Using xeus-cpp
99
xeus-cpp. Thereby you can write and execute C++ code interactively in
1010
this environment.
1111

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

docs/source/debug.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Debugging and Testing
2+
--------------------
3+
4+
Debugging
5+
========================
6+
7+
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.
8+
9+
.. code-block:: bash
10+
11+
cmake -D CMAKE_BUILD_TYPE=Debug ..
12+
13+
In the same folder, run the command and copy the JSON displayed in the terminal.
14+
15+
.. code-block:: bash
16+
17+
xcpp
18+
19+
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.
20+
21+
.. code-block:: bash
22+
23+
jupyter console --existing yourJSONFile.json
24+
25+
Open a new terminal, navigate to the build directory, and run GDB to start debugging.
26+
27+
.. code-block:: bash
28+
29+
gdb xcpp
30+
31+
32+
Testing
33+
========================
34+
35+
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.

docs/source/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ The Xeus-Cpp is a Jupyter kernel for the C++ programming language
3535
UsingXeus-Cpp
3636
tutorials
3737
dev-build-options
38+
debug
3839
FAQ
3940
reference
4041

0 commit comments

Comments
 (0)