|
iPXE
|
GDB stub for remote debugging. More...
#include <stdlib.h>#include <stdio.h>#include <string.h>#include <ctype.h>#include <byteswap.h>#include <ipxe/gdbstub.h>Go to the source code of this file.
Data Structures | |
| struct | gdbstub |
Enumerations | |
| enum | { POSIX_EINVAL = 0x1c , SIZEOF_PAYLOAD = 512 } |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
| FILE_SECBOOT (FORBIDDEN) | |
| static void | gdbstub_state_new (struct gdbstub *stub, char ch) |
| static void | gdbstub_state_data (struct gdbstub *stub, char ch) |
| static void | gdbstub_state_cksum1 (struct gdbstub *stub, char ch) |
| static void | gdbstub_state_cksum2 (struct gdbstub *stub, char ch) |
| static void | gdbstub_state_wait_ack (struct gdbstub *stub, char ch) |
| static uint8_t | gdbstub_from_hex_digit (char ch) |
| static uint8_t | gdbstub_to_hex_digit (uint8_t b) |
| static void | gdbstub_from_hex_buf (char *dst, char *src, int lenbytes) |
| static void | gdbstub_to_hex_buf (char *dst, char *src, int lenbytes) |
| static uint8_t | gdbstub_cksum (char *data, int len) |
| static void | gdbstub_tx_packet (struct gdbstub *stub) |
| static void | gdbstub_send_ok (struct gdbstub *stub) |
| static void | gdbstub_send_num_packet (struct gdbstub *stub, char reply, int num) |
| static int | gdbstub_get_packet_args (struct gdbstub *stub, unsigned long *args, int nargs, int *stop_idx) |
| static void | gdbstub_send_errno (struct gdbstub *stub, int errno) |
| static void | gdbstub_report_signal (struct gdbstub *stub) |
| static void | gdbstub_read_regs (struct gdbstub *stub) |
| static void | gdbstub_write_regs (struct gdbstub *stub) |
| static void | gdbstub_read_mem (struct gdbstub *stub) |
| static void | gdbstub_write_mem (struct gdbstub *stub) |
| static void | gdbstub_continue (struct gdbstub *stub, int single_step) |
| static void | gdbstub_breakpoint (struct gdbstub *stub) |
| static void | gdbstub_rx_packet (struct gdbstub *stub) |
| static void | gdbstub_parse (struct gdbstub *stub, char ch) |
| void | gdbstub_handler (int signo, gdbreg_t *regs) |
| Interrupt handler. | |
| struct gdb_transport * | find_gdb_transport (const char *name) |
| Look up GDB transport by name. | |
| void | gdbstub_start (struct gdb_transport *trans) |
| Break into the debugger using the given transport. | |
Variables | |
| static struct gdbstub | stub |
GDB stub for remote debugging.
Definition in file gdbstub.c.
| anonymous enum |
| FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
| FILE_SECBOOT | ( | FORBIDDEN | ) |
|
static |
Definition at line 312 of file gdbstub.c.
References ch, gdbstub_state_data(), and stub.
Referenced by gdbstub_state_cksum2(), and gdbstub_state_wait_ack().
|
static |
Definition at line 319 of file gdbstub.c.
References ch, gdbstub_state_cksum1(), SIZEOF_PAYLOAD, and stub.
Referenced by gdbstub_state_new().
|
static |
Definition at line 332 of file gdbstub.c.
References ch, gdbstub_from_hex_digit(), gdbstub_state_cksum2(), and stub.
Referenced by gdbstub_state_data().
|
static |
Definition at line 337 of file gdbstub.c.
References ch, gdbstub_cksum(), gdbstub_from_hex_digit(), gdbstub_rx_packet(), gdbstub_state_new(), and stub.
Referenced by gdbstub_state_cksum1().
|
static |
Definition at line 354 of file gdbstub.c.
References ch, gdbstub_state_new(), gdbstub_tx_packet(), and stub.
Referenced by gdbstub_tx_packet().
|
static |
Definition at line 71 of file gdbstub.c.
References ch, isdigit(), and tolower().
Referenced by gdbstub_from_hex_buf(), gdbstub_get_packet_args(), gdbstub_state_cksum1(), and gdbstub_state_cksum2().
Definition at line 75 of file gdbstub.c.
Referenced by gdbstub_send_num_packet(), gdbstub_to_hex_buf(), and gdbstub_tx_packet().
|
static |
Definition at line 85 of file gdbstub.c.
References cpu_to_le16, cpu_to_le32, gdbstub_from_hex_digit(), and src.
Referenced by gdbstub_write_mem(), and gdbstub_write_regs().
|
static |
Definition at line 111 of file gdbstub.c.
References cpu_to_le16, cpu_to_le32, gdbstub_to_hex_digit(), and src.
Referenced by gdbstub_read_mem(), and gdbstub_read_regs().
|
static |
Definition at line 137 of file gdbstub.c.
Referenced by gdbstub_state_cksum2(), and gdbstub_tx_packet().
|
static |
Definition at line 145 of file gdbstub.c.
References gdbstub_cksum(), gdbstub_state_wait_ack(), gdbstub_to_hex_digit(), and stub.
Referenced by gdbstub_breakpoint(), gdbstub_read_mem(), gdbstub_read_regs(), gdbstub_rx_packet(), gdbstub_send_num_packet(), gdbstub_send_ok(), and gdbstub_state_wait_ack().
|
static |
Definition at line 156 of file gdbstub.c.
References gdbstub_tx_packet(), and stub.
Referenced by gdbstub_breakpoint(), gdbstub_rx_packet(), gdbstub_write_mem(), and gdbstub_write_regs().
|
static |
Definition at line 163 of file gdbstub.c.
References gdbstub_to_hex_digit(), gdbstub_tx_packet(), num, and stub.
Referenced by gdbstub_report_signal(), and gdbstub_send_errno().
|
static |
Definition at line 172 of file gdbstub.c.
References ch, gdbstub_from_hex_digit(), stub, and val.
Referenced by gdbstub_breakpoint(), gdbstub_continue(), gdbstub_read_mem(), and gdbstub_write_mem().
|
static |
Definition at line 197 of file gdbstub.c.
References errno, gdbstub_send_num_packet(), and stub.
Referenced by gdbstub_breakpoint(), gdbstub_read_mem(), gdbstub_write_mem(), and gdbstub_write_regs().
|
static |
Definition at line 201 of file gdbstub.c.
References gdbstub_send_num_packet(), and stub.
Referenced by gdbstub_handler(), and gdbstub_rx_packet().
|
static |
Definition at line 205 of file gdbstub.c.
References GDBMACH_SIZEOF_REGS, gdbstub_to_hex_buf(), gdbstub_tx_packet(), and stub.
Referenced by gdbstub_rx_packet().
|
static |
Definition at line 211 of file gdbstub.c.
References GDBMACH_SIZEOF_REGS, gdbstub_from_hex_buf(), gdbstub_send_errno(), gdbstub_send_ok(), POSIX_EINVAL, and stub.
Referenced by gdbstub_rx_packet().
|
static |
Definition at line 220 of file gdbstub.c.
References gdbstub_get_packet_args(), gdbstub_send_errno(), gdbstub_to_hex_buf(), gdbstub_tx_packet(), NULL, POSIX_EINVAL, SIZEOF_PAYLOAD, and stub.
Referenced by gdbstub_rx_packet().
|
static |
Definition at line 232 of file gdbstub.c.
References gdbstub_from_hex_buf(), gdbstub_get_packet_args(), gdbstub_send_errno(), gdbstub_send_ok(), POSIX_EINVAL, and stub.
Referenced by gdbstub_rx_packet().
|
static |
Definition at line 245 of file gdbstub.c.
References gdbmach_set_pc(), gdbmach_set_single_step(), gdbstub_get_packet_args(), NULL, and stub.
Referenced by gdbstub_rx_packet().
|
static |
Definition at line 255 of file gdbstub.c.
References gdbmach_set_breakpoint(), gdbstub_get_packet_args(), gdbstub_send_errno(), gdbstub_send_ok(), gdbstub_tx_packet(), NULL, POSIX_EINVAL, rc, and stub.
Referenced by gdbstub_rx_packet().
|
static |
Definition at line 274 of file gdbstub.c.
References gdbstub_breakpoint(), gdbstub_continue(), gdbstub_read_mem(), gdbstub_read_regs(), gdbstub_report_signal(), gdbstub_send_ok(), gdbstub_tx_packet(), gdbstub_write_mem(), gdbstub_write_regs(), and stub.
Referenced by gdbstub_state_cksum2().
|
static |
| void gdbstub_handler | ( | int | signo, |
| gdbreg_t * | regs ) |
Interrupt handler.
@signo POSIX signal number @regs CPU register snapshot
Definition at line 372 of file gdbstub.c.
References gdbstub_parse(), gdbstub_report_signal(), len, regs, gdbstub::signo, SIZEOF_PAYLOAD, and stub.
Referenced by gdbmach_handler().
| struct gdb_transport * find_gdb_transport | ( | const char * | name | ) |
Look up GDB transport by name.
| name | Name of transport |
| GDB | transport or NULL |
Definition at line 392 of file gdbstub.c.
References for_each_table_entry, GDB_TRANSPORTS, gdb_transport::name, name, NULL, and strcmp().
Referenced by parse_gdb_transport().
| void gdbstub_start | ( | struct gdb_transport * | trans | ) |
Break into the debugger using the given transport.
| trans | GDB transport |
Definition at line 403 of file gdbstub.c.
References gdbmach_breakpoint(), gdbmach_init(), and stub.
Referenced by gdbstub_exec().
|
static |
Definition at line 368 of file gdbstub.c.
Referenced by gdbstub_breakpoint(), gdbstub_continue(), gdbstub_get_packet_args(), gdbstub_handler(), gdbstub_parse(), gdbstub_read_mem(), gdbstub_read_regs(), gdbstub_report_signal(), gdbstub_rx_packet(), gdbstub_send_errno(), gdbstub_send_num_packet(), gdbstub_send_ok(), gdbstub_start(), gdbstub_state_cksum1(), gdbstub_state_cksum2(), gdbstub_state_data(), gdbstub_state_new(), gdbstub_state_wait_ack(), gdbstub_tx_packet(), gdbstub_write_mem(), and gdbstub_write_regs().