Zephyr API Documentation 4.0.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Architecture-specific gdbstub APIs

Functions

void arch_gdb_init (void)
 Architecture layer debug start.
 
void arch_gdb_continue (void)
 Continue running program.
 
void arch_gdb_step (void)
 Continue with one step.
 
size_t arch_gdb_reg_readall (struct gdb_ctx *ctx, uint8_t *buf, size_t buflen)
 Read all registers, and outputs as hexadecimal string.
 
size_t arch_gdb_reg_writeall (struct gdb_ctx *ctx, uint8_t *hex, size_t hexlen)
 Take a hexadecimal string and update all registers.
 
size_t arch_gdb_reg_readone (struct gdb_ctx *ctx, uint8_t *buf, size_t buflen, uint32_t regno)
 Read one register, and outputs as hexadecimal string.
 
size_t arch_gdb_reg_writeone (struct gdb_ctx *ctx, uint8_t *hex, size_t hexlen, uint32_t regno)
 Take a hexadecimal string and update one register.
 
int arch_gdb_add_breakpoint (struct gdb_ctx *ctx, uint8_t type, uintptr_t addr, uint32_t kind)
 Add breakpoint or watchpoint.
 
int arch_gdb_remove_breakpoint (struct gdb_ctx *ctx, uint8_t type, uintptr_t addr, uint32_t kind)
 Remove breakpoint or watchpoint.
 

Detailed Description

Function Documentation

◆ arch_gdb_add_breakpoint()

int arch_gdb_add_breakpoint ( struct gdb_ctx * ctx,
uint8_t type,
uintptr_t addr,
uint32_t kind )

#include <zephyr/arch/arch_interface.h>

Add breakpoint or watchpoint.

Parameters
ctxGDB context
typeBreakpoint or watchpoint type
addrAddress of breakpoint or watchpoint
kindSize of breakpoint/watchpoint in bytes
Return values
0Operation successful
-1Error encountered
-2Not supported

◆ arch_gdb_continue()

void arch_gdb_continue ( void )

#include <zephyr/arch/arch_interface.h>

Continue running program.

Continue software execution.

◆ arch_gdb_init()

void arch_gdb_init ( void )

#include <zephyr/arch/arch_interface.h>

Architecture layer debug start.

This function is called by gdb_init()

◆ arch_gdb_reg_readall()

size_t arch_gdb_reg_readall ( struct gdb_ctx * ctx,
uint8_t * buf,
size_t buflen )

#include <zephyr/arch/arch_interface.h>

Read all registers, and outputs as hexadecimal string.

This reads all CPU registers and outputs as hexadecimal string. The output string must be parsable by GDB.

Parameters
ctxGDB context
bufBuffer to output hexadecimal string.
buflenLength of buffer.
Returns
Length of hexadecimal string written. Return 0 if error or not supported.

◆ arch_gdb_reg_readone()

size_t arch_gdb_reg_readone ( struct gdb_ctx * ctx,
uint8_t * buf,
size_t buflen,
uint32_t regno )

#include <zephyr/arch/arch_interface.h>

Read one register, and outputs as hexadecimal string.

This reads one CPU register and outputs as hexadecimal string. The output string must be parsable by GDB.

Parameters
ctxGDB context
bufBuffer to output hexadecimal string.
buflenLength of buffer.
regnoRegister number
Returns
Length of hexadecimal string written. Return 0 if error or not supported.

◆ arch_gdb_reg_writeall()

size_t arch_gdb_reg_writeall ( struct gdb_ctx * ctx,
uint8_t * hex,
size_t hexlen )

#include <zephyr/arch/arch_interface.h>

Take a hexadecimal string and update all registers.

This takes in a hexadecimal string as presented from GDB, and updates all CPU registers with new values.

Parameters
ctxGDB context
hexInput hexadecimal string.
hexlenLength of hexadecimal string.
Returns
Length of hexadecimal string parsed. Return 0 if error or not supported.

◆ arch_gdb_reg_writeone()

size_t arch_gdb_reg_writeone ( struct gdb_ctx * ctx,
uint8_t * hex,
size_t hexlen,
uint32_t regno )

#include <zephyr/arch/arch_interface.h>

Take a hexadecimal string and update one register.

This takes in a hexadecimal string as presented from GDB, and updates one CPU registers with new value.

Parameters
ctxGDB context
hexInput hexadecimal string.
hexlenLength of hexadecimal string.
regnoRegister number
Returns
Length of hexadecimal string parsed. Return 0 if error or not supported.

◆ arch_gdb_remove_breakpoint()

int arch_gdb_remove_breakpoint ( struct gdb_ctx * ctx,
uint8_t type,
uintptr_t addr,
uint32_t kind )

#include <zephyr/arch/arch_interface.h>

Remove breakpoint or watchpoint.

Parameters
ctxGDB context
typeBreakpoint or watchpoint type
addrAddress of breakpoint or watchpoint
kindSize of breakpoint/watchpoint in bytes
Return values
0Operation successful
-1Error encountered
-2Not supported

◆ arch_gdb_step()

void arch_gdb_step ( void )

#include <zephyr/arch/arch_interface.h>

Continue with one step.

Continue software execution until reaches the next statement.