From b3c50c7c4a8f5d00e166b444557b95f861926144 Mon Sep 17 00:00:00 2001 From: tharun571 Date: Mon, 13 May 2024 21:36:36 +0530 Subject: [PATCH 1/2] Add debug documentation --- docs/source/debug.rst | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docs/source/debug.rst diff --git a/docs/source/debug.rst b/docs/source/debug.rst new file mode 100644 index 00000000..9992c1b4 --- /dev/null +++ b/docs/source/debug.rst @@ -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. \ No newline at end of file From e68a8b1be4f3cea1c89fe34fc904e9af93c8a3be Mon Sep 17 00:00:00 2001 From: tharun571 Date: Mon, 13 May 2024 21:41:43 +0530 Subject: [PATCH 2/2] Update documentation --- docs/source/UsingXeus-Cpp.rst | 4 ---- docs/source/index.rst | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/source/UsingXeus-Cpp.rst b/docs/source/UsingXeus-Cpp.rst index 5e2895e2..b834d63c 100644 --- a/docs/source/UsingXeus-Cpp.rst +++ b/docs/source/UsingXeus-Cpp.rst @@ -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. - diff --git a/docs/source/index.rst b/docs/source/index.rst index 785e27ba..3a7ee4b1 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -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