Zephyr API Documentation 4.0.0-rc3
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
gdbstub.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Marek Vedral <vedrama5@fel.cvut.cz>
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_GDBSTUB_H_
8#define ZEPHYR_INCLUDE_ARCH_ARM_AARCH32_GDBSTUB_H_
9
11
12#ifndef _ASMLANGUAGE
13
14#define DBGDSCR_MONITOR_MODE_EN 0x8000
15
16#define SPSR_ISETSTATE_ARM 0x0
17#define SPSR_ISETSTATE_JAZELLE 0x2
18#define SPSR_J 24
19#define SPSR_T 5
20
21/* Debug Breakpoint Control Register constants */
22#define DBGDBCR_MEANING_MASK 0x7
23#define DBGDBCR_MEANING_SHIFT 20
24#define DBGDBCR_MEANING_ADDR_MISMATCH 0x4
25#define DBGDBCR_BYTE_ADDR_MASK 0xF
26#define DBGDBCR_BYTE_ADDR_SHIFT 5
27#define DBGDBCR_BRK_EN_MASK 0x1
28
29/* Regno of the SPSR */
30#define SPSR_REG_IDX 25
31/* Minimal size of the packet - SPSR is the last, 42-nd byte, see packet_pos array */
32#define GDB_READALL_PACKET_SIZE (42 * 8)
33
34#define IFSR_DEBUG_EVENT 0x2
35
37 R0 = 0,
41 /* READONLY registers (R4 - R13) except R12 */
51 /* Stack pointer - READONLY */
55 /* Saved program status register */
58};
59
60/* required structure */
61struct gdb_ctx {
62 /* cause of the exception */
63 unsigned int exception;
64 unsigned int registers[GDB_NUM_REGS];
65};
66
67void z_gdb_entry(struct arch_esf *esf, unsigned int exc_cause);
68
69#endif
70
71#endif
AARCH32_GDB_REG
Definition gdbstub.h:36
@ R7
Definition gdbstub.h:45
@ R13
Definition gdbstub.h:52
@ SPSR
Definition gdbstub.h:56
@ R4
Definition gdbstub.h:42
@ R12
Definition gdbstub.h:50
@ R9
Definition gdbstub.h:47
@ R2
Definition gdbstub.h:39
@ LR
Definition gdbstub.h:53
@ R5
Definition gdbstub.h:43
@ R0
Definition gdbstub.h:37
@ R6
Definition gdbstub.h:44
@ PC
Definition gdbstub.h:54
@ R3
Definition gdbstub.h:40
@ GDB_NUM_REGS
Definition gdbstub.h:57
@ R8
Definition gdbstub.h:46
@ R11
Definition gdbstub.h:49
@ R10
Definition gdbstub.h:48
@ R1
Definition gdbstub.h:38
ARM AArch32 public exception handling.
Exception Stack Frame.
Definition exception.h:60
Architecture specific GDB context.
Definition gdbstub.h:61
unsigned int registers[GDB_NUM_REGS]
Definition gdbstub.h:64
unsigned int exception
Exception reason.
Definition gdbstub.h:63