Select one of the symbols to view example projects that use it.
 
Outline
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#include "esp_gdbstub_arch.h"
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_private/freertos_debug.h"
#define GDBSTUB_ST_ENDPACKET
#define GDBSTUB_ST_ERR
#define GDBSTUB_ST_OK
#define GDBSTUB_ST_CONT
#define GDBSTUB_CUR_TASK_INDEX_UNKNOWN
#define GDBSTUB_CMD_BUFLEN
esp_gdbstub_state_t
#define GDBSTUB_TASKS_NUM
esp_gdbstub_scratch_t
s_scratch;
esp_gdbstub_get_signal(const esp_gdbstub_frame_t *);
esp_gdbstub_frame_to_regfile(const esp_gdbstub_frame_t *, esp_gdbstub_gdb_regfile_t *);
esp_gdbstub_int(void *);
gdbstub_handle_uart_int(esp_gdbstub_frame_t *);
esp_gdbstub_tcb_to_regfile(TaskHandle_t, esp_gdbstub_gdb_regfile_t *);
esp_gdbstub_getchar();
esp_gdbstub_putchar(int);
esp_gdbstub_flush();
esp_gdbstub_send_start();
esp_gdbstub_send_char(char);
esp_gdbstub_send_str(const char *);
esp_gdbstub_send_hex(int, int);
esp_gdbstub_send_end();
esp_gdbstub_send_str_packet(const char *);
esp_gdbstub_gethex(const unsigned char **, int);
esp_gdbstub_read_command(unsigned char **, size_t *);
esp_gdbstub_handle_command(unsigned char *, int);
esp_gdbstub_init_dports();
esp_gdbstub_stall_other_cpus_start();
esp_gdbstub_stall_other_cpus_end();
esp_gdbstub_clear_step();
esp_gdbstub_do_step(esp_gdbstub_frame_t *);
esp_gdbstub_trigger_cpu();
esp_gdbstub_set_register(esp_gdbstub_frame_t *, uint32_t, uint32_t);
Files
loading...
SourceVuESP-IDF Framework and ExamplesESP-IDFcomponents/esp_gdbstub/private_include/esp_gdbstub_common.h
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
/* * SPDX-FileCopyrightText: 2020-2022 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 *//* ... */ #pragma once #include <stdint.h> #include <stddef.h> #include <stdbool.h> #include "esp_gdbstub_arch.h" #include "sdkconfig.h"5 includes #ifdef CONFIG_ESP_GDBSTUB_SUPPORT_TASKS #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "esp_private/freertos_debug.h"/* ... */ #endif // CONFIG_ESP_GDBSTUB_SUPPORT_TASKS /* Internal error codes used by the routines that parse the incoming gdb packet */ #define GDBSTUB_ST_ENDPACKET -1 #define GDBSTUB_ST_ERR -2 #define GDBSTUB_ST_OK -3 #define GDBSTUB_ST_CONT -4 /* Special task index values */ #define GDBSTUB_CUR_TASK_INDEX_UNKNOWN -15 defines #ifndef GDBSTUB_CMD_BUFLEN #define GDBSTUB_CMD_BUFLEN 512 #endif #if CONFIG_ESP_GDBSTUB_SUPPORT_TASKS typedef enum { GDBSTUB_NOT_STARTED, GDBSTUB_STARTED, GDBSTUB_TASK_SUPPORT_DISABLED }{ ... } esp_gdbstub_state_t; #define GDBSTUB_TASKS_NUM CONFIG_ESP_GDBSTUB_MAX_TASKS /* ... */ #endif // CONFIG_ESP_GDBSTUB_SUPPORT_TASKS /* gdbstub temporary run-time data, stored in .bss to reduce stack usage */ typedef struct { esp_gdbstub_gdb_regfile_t regfile; int signal; #if CONFIG_ESP_GDBSTUB_SUPPORT_TASKS esp_gdbstub_state_t state; int task_count; int paniced_task_index; int current_task_index; int thread_info_index; //!< index of the last task passed to qsThreadInfo esp_gdbstub_frame_t paniced_frame; TaskSnapshot_t tasks[GDBSTUB_TASKS_NUM]; // TODO: add an API to get snapshots one by one/* ... */ #endif // CONFIG_ESP_GDBSTUB_SUPPORT_TASKS }{ ... } esp_gdbstub_scratch_t; extern esp_gdbstub_scratch_t s_scratch; /**** Functions provided by the architecture specific part ****/ /** * @param frame exception frame pointer * @return the appropriate "signal" number for the given exception cause *//* ... */ int esp_gdbstub_get_signal(const esp_gdbstub_frame_t *frame); /** * Write registers from the exception frame to the GDB register file * @param frame exception frame to parse * @param dst pointer to the GDB register file *//* ... */ void esp_gdbstub_frame_to_regfile(const esp_gdbstub_frame_t *frame, esp_gdbstub_gdb_regfile_t *dst); /** * Signal handler for debugging interrupts of the application. *//* ... */ void esp_gdbstub_int(void *frame); /** * Signal handler for transport protocol interrupts. *//* ... */ void gdbstub_handle_uart_int(esp_gdbstub_frame_t *regs_frame); #if CONFIG_ESP_GDBSTUB_SUPPORT_TASKS /** * Write registers from the saved frame of a given task to the GDB register file * @param tcb pointer to the TCB of the task * @param dst pointer to the GDB register file *//* ... */ void esp_gdbstub_tcb_to_regfile(TaskHandle_t tcb, esp_gdbstub_gdb_regfile_t *dst);/* ... */ #endif // CONFIG_ESP_GDBSTUB_SUPPORT_TASKS /**** UART related functions ****/ /** * Receive a byte from the GDB client. Blocks until a byte is available. * @return received byte *//* ... */ int esp_gdbstub_getchar(void); /** * Send a byte to the GDB client * @param c byte to send *//* ... */ void esp_gdbstub_putchar(int c); /** * Make sure all bytes sent using putchar() end up at the host. * (Usually stubbed for UART, but can be useful for other channels) *//* ... */ void esp_gdbstub_flush(void); #ifdef CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME /** * Read a data from fifo and detect start symbol * @return 1 if break symbol was detected, or 0 if not *//* ... */ int esp_gdbstub_getfifo(void);/* ... */ #endif // CONFIG_ESP_SYSTEM_GDBSTUB_RUNTIME /**** GDB packet related functions ****/ /** Begin a packet */ void esp_gdbstub_send_start(void); /** Send a character as part of the packet */ void esp_gdbstub_send_char(char c); /** Send a string as part of the packet */ void esp_gdbstub_send_str(const char *s); /** Send a hex value as part of the packet */ void esp_gdbstub_send_hex(int val, int bits); /** Finish sending the packet */ void esp_gdbstub_send_end(void); /** Send a packet with a string as content */ void esp_gdbstub_send_str_packet(const char *str); /** Get a hex value from the gdb packet */ uint32_t esp_gdbstub_gethex(const unsigned char **ptr, int bits); /** Read, unescape, and validate the incoming GDB command */ int esp_gdbstub_read_command(unsigned char **out_cmd, size_t *out_size); /** Handle a command received from gdb */ int esp_gdbstub_handle_command(unsigned char *cmd, int len); void esp_gdbstub_init_dports(void); void esp_gdbstub_stall_other_cpus_start(void); void esp_gdbstub_stall_other_cpus_end(void); void esp_gdbstub_clear_step(void); void esp_gdbstub_do_step(esp_gdbstub_frame_t *regs_frame); void esp_gdbstub_trigger_cpu(void); /** * Write a value to register in frame * @param frame gdbstub frame * @param reg_index register index, depends on architecture * @param value 32 bit data value *//* ... */ void esp_gdbstub_set_register(esp_gdbstub_frame_t *frame, uint32_t reg_index, uint32_t value);
Details
Show:
from
Types: Columns:
This file uses the notable symbols shown below. Click anywhere in the file to view more details.