zephyr/subsys/debug/gdbstub_backend.h
Flavio Ceolin 5408f3102d debug: x86: Add gdbstub for X86
It implements gdb remote protocol to talk with a host gdb during the
debug session. The implementation is divided in three layers:

1 - The top layer that is responsible for the gdb remote protocol.
2 - An architecture specific layer responsible to write/read registers,
    set breakpoints, handle exceptions, ...
3 - A transport layer to be used to communicate with the host

The communication with GDB in the host is synchronous and the systems
stops execution waiting for instructions and return its execution after
a "continue" or "step" command. The protocol has an exception that is
when the host sends a packet to cause an interruption, usually triggered
by a Ctrl-C. This implementation ignores this instruction though.

This initial work supports only X86 using uart as backend.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
2020-09-02 20:54:57 -04:00

49 lines
988 B
C

/*
* Copyright (c) 2020 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#ifndef ZEPHYR_SUBSYS_DEBUG_GDBSTUB_BACKEND_H_
#define ZEPHYR_SUBSYS_DEBUG_GDBSTUB_BACKEND_H_
#include <stdint.h>
/**
* This is an internal header. These API is intended to be used
* exclusively by gdbstub.
*
* A backend has to implement these three functions knowing that they
* will be called in an interruption context.
*/
/**
* @brief Initialize the gdbstub backend
*
* This function is called from @c gdb_start to
* give the opportunity to the backend initialize properly.
*
* @retval 0 In case of success
* @retval -1 If the backend was not initialized properly
*/
int z_gdb_backend_init(void);
/**
* @brief Output a character
*
* @param ch Character to send
*/
void z_gdb_putchar(unsigned char ch);
/**
* @brief Receive a character
*
* This function blocks until have a valid
* character to return.
*
* @return A character
*/
char z_gdb_getchar(void);
#endif