Commit c8d6a62b authored by Dmitrii Golovanov's avatar Dmitrii Golovanov Committed by Carles Cufi
Browse files

samples: gdbstub: doc: Remove redundant sample



Remove gdbstub sample (samples/subsys/debug/gdbstub) as duplicated
by a test (tests/subsys/debug/gdbstub).

Update the GDB stub documentation.

Signed-off-by: default avatarDmitrii Golovanov <dmitrii.golovanov@intel.com>
parent 664d9678
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -87,8 +87,9 @@ Using Serial Backend
Example
*******

This is an example using ``samples/subsys/debug/gdbstub`` to demonstrate
how GDB stub works.
This is an example to demonstrate how GDB stub works.
You can also refer to ``tests/subsys/debug/gdbstub``
for its implementation as a Twister test.

#. Open two terminal windows.

+0 −12
Original line number Diff line number Diff line
# SPDX-License-Identifier: Apache-2.0

cmake_minimum_required(VERSION 3.20.0)

if(BOARD MATCHES "qemu_x86")
  list(APPEND QEMU_EXTRA_FLAGS -serial tcp:127.0.0.1:5678,server)
endif()

find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(debug)

target_sources(app PRIVATE src/main.c)
+0 −31
Original line number Diff line number Diff line
.. zephyr:code-sample:: gdb-debug
   :name: GDB debug

   Use GDB Remote Serial Protocol to debug a Zephyr application running on QEMU.

Overview
********

A simple sample that can be used with QEMU to show debug using GDB
Remote Serial Protocol (RSP) capabilities.

Building and Running
********************

This application can be built and executed on QEMU as follows:

.. zephyr-app-commands::
   :zephyr-app: samples/subsys/debug/gdbstub
   :host-os: unix
   :board: qemu_x86
   :goals: run
   :compact:

Open a new terminal and use gdb to connect to the running qemu as follows:

.. code-block:: bash

    gdb build/zephyr/zephyr.elf
    (gdb) target remote :5678

Exit QEMU by pressing :kbd:`CTRL+A` :kbd:`x`.
+0 −7
Original line number Diff line number Diff line
/* SPDX-License-Identifier: Apache-2.0 */

/ {
	chosen {
		zephyr,gdbstub-uart = &uart1;
	};
};
+0 −7
Original line number Diff line number Diff line
/* SPDX-License-Identifier: Apache-2.0 */

/ {
	chosen {
		zephyr,gdbstub-uart = &uart1;
	};
};
Loading