Zephyr API Documentation
3.7.0
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
10
#include <zephyr/arch/arm/exc.h>
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
36
enum
AARCH32_GDB_REG
{
37
R0
= 0,
38
R1
,
39
R2
,
40
R3
,
41
/* READONLY registers (R4 - R13) except R12 */
42
R4
,
43
R5
,
44
R6
,
45
R7
,
46
R8
,
47
R9
,
48
R10
,
49
R11
,
50
R12
,
51
/* Stack pointer - READONLY */
52
R13
,
53
LR
,
54
PC
,
55
/* Saved program status register */
56
SPSR
,
57
GDB_NUM_REGS
58
};
59
60
/* required structure */
61
struct
gdb_ctx
{
62
/* cause of the exception */
63
unsigned
int
exception
;
64
unsigned
int
registers
[
GDB_NUM_REGS
];
65
};
66
67
void
z_gdb_entry(
struct
arch_esf
*esf,
unsigned
int
exc_cause);
68
69
#endif
70
71
#endif
AARCH32_GDB_REG
AARCH32_GDB_REG
Definition:
gdbstub.h:36
R7
@ R7
Definition:
gdbstub.h:45
R13
@ R13
Definition:
gdbstub.h:52
SPSR
@ SPSR
Definition:
gdbstub.h:56
R4
@ R4
Definition:
gdbstub.h:42
R12
@ R12
Definition:
gdbstub.h:50
R9
@ R9
Definition:
gdbstub.h:47
R2
@ R2
Definition:
gdbstub.h:39
LR
@ LR
Definition:
gdbstub.h:53
R5
@ R5
Definition:
gdbstub.h:43
R0
@ R0
Definition:
gdbstub.h:37
R6
@ R6
Definition:
gdbstub.h:44
PC
@ PC
Definition:
gdbstub.h:54
R3
@ R3
Definition:
gdbstub.h:40
GDB_NUM_REGS
@ GDB_NUM_REGS
Definition:
gdbstub.h:57
R8
@ R8
Definition:
gdbstub.h:46
R11
@ R11
Definition:
gdbstub.h:49
R10
@ R10
Definition:
gdbstub.h:48
R1
@ R1
Definition:
gdbstub.h:38
arch_esf
Exception Stack Frame.
Definition:
exception.h:57
gdb_ctx
Architecture specific GDB context.
Definition:
gdbstub.h:61
gdb_ctx::registers
unsigned int registers[GDB_NUM_REGS]
Definition:
gdbstub.h:64
gdb_ctx::exception
unsigned int exception
Exception reason.
Definition:
gdbstub.h:63
zephyr
arch
arm
gdbstub.h
Generated on Fri Jul 26 2024 14:01:56 for Zephyr API Documentation by
1.9.6