Skip to content

Commit

Permalink
[Documentation] Fix How-to-Debug.rst (#331)
Browse files Browse the repository at this point in the history
Code-blocks are not showing up correctly because of the indentation
  • Loading branch information
dayeol committed May 14, 2023
1 parent a85df47 commit 300eede
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions docs/source/Getting-Started/How-to-Debug.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ First compile with debugging symbols

.. code-block:: bash
# in your <build directory>
cmake -DCMAKE_BUILD_TYPE=Debug ..
# in your <build directory>
cmake -DCMAKE_BUILD_TYPE=Debug ..
From your `build` directory where you ran `make`, use:

.. code-block:: bash
./scripts/run-qemu.sh -debug
./scripts/run-qemu.sh -debug
All cores will immediately hang at the first instruction (i.e., bootrom), waiting for `gdb` to be attached.
Expand All @@ -32,23 +32,23 @@ For example, if you want to debug with the `bbl` symbols

.. code-block:: bash
# in your <build directory>
riscv64-unknown-linux-gnu-gdb ./sm.build/platform/generic/firmware/fw_payload.elf
# in your <build directory>
riscv64-unknown-linux-gnu-gdb ./sm.build/platform/generic/firmware/fw_payload.elf
If you want to debug with the kernel's debug information

.. code-block:: bash
# in your <build directory>
riscv64-unknown-linux-gnu-gdb ./linux.build/vmlinux
# in your <build directory>
riscv64-unknown-linux-gnu-gdb ./linux.build/vmlinux
Then, attach to QEMU on the port printed by the starting qemu script:

.. code-block:: bash
(gdb) target remote localhost:$PORT
(gdb) target remote localhost:$PORT
Now, you can start debugging the SM (bbl) or the kernel.
Expand All @@ -58,7 +58,7 @@ Before setting breakpoints, you should run following command:

.. code-block:: bash
(gdb) set riscv use-compressed-breakpoints no
(gdb) set riscv use-compressed-breakpoints no
To see why we need that command, see [this issue](https://github.com/riscv/riscv-binutils-gdb/issues/106)
Expand All @@ -74,5 +74,5 @@ For example,

.. code-block:: bash
./riscv-qemu/riscv64-softmmu/qemu-system-riscv64 -d in_asm -D debug.log #...etc...
./riscv-qemu/riscv64-softmmu/qemu-system-riscv64 -d in_asm -D debug.log #...etc...

0 comments on commit 300eede

Please sign in to comment.