76 return ( b < 0xa ?
'0' :
'a' - 0xa ) + b;
85 if ( lenbytes == 2 && ( (
unsigned long ) dst & 0x1 ) == 0 ) {
91 }
else if ( lenbytes == 4 && ( (
unsigned long ) dst & 0x3 ) == 0 ) {
102 while ( lenbytes-- > 0 ) {
111 if ( lenbytes == 2 && ( (
unsigned long )
src & 0x1 ) == 0 ) {
117 }
else if ( lenbytes == 4 && ( (
unsigned long )
src & 0x3 ) == 0 ) {
128 while ( lenbytes-- > 0 ) {
138 while (
len-- > 0 ) {
175 unsigned long val = 0;
176 for ( i = 1; i <
stub->
len && argc < nargs; i++ ) {
180 }
else if (
ch ==
',' ) {
181 args [ argc++ ] =
val;
190 if ( argc < nargs ) {
191 args [ argc++ ] =
val;
193 return ( ( i ==
stub->
len ||
ch ==
':' ) && argc == nargs );
220 unsigned long args [ 2 ];
232 unsigned long args [ 2 ];
236 (
stub->
len - colon - 1 ) % 2 != 0 ) {
255 unsigned long args [ 3 ];
264 args [ 2 ], enable ) ) != 0 ) {
321 }
else if (
ch ==
'$' ) {
343 if ( their_cksum == our_cksum ) {
385 for ( i = 0; i <
len; i++ ) {
struct arbelprm_rc_send_wqe rc
static uint8_t gdbstub_cksum(char *data, int len)
static void gdbstub_state_wait_ack(struct gdbstub *stub, char ch)
struct gdb_transport * find_gdb_transport(const char *name)
Look up GDB transport by name.
const char * name
Transport name.
void(* parse)(struct gdbstub *stub, char ch)
static void gdbstub_state_cksum2(struct gdbstub *stub, char ch)
static void gdbmach_breakpoint(void)
static void gdbstub_send_num_packet(struct gdbstub *stub, char reply, int num)
static void gdbstub_state_cksum1(struct gdbstub *stub, char ch)
int gdbmach_set_breakpoint(int type, unsigned long addr, size_t len, int enable)
Set hardware breakpoint.
void gdbmach_init(void)
Initialise GDB.
static void gdbstub_state_data(struct gdbstub *stub, char ch)
static void gdbstub_continue(struct gdbstub *stub, int single_step)
static void gdbstub_report_signal(struct gdbstub *stub)
static int gdbstub_get_packet_args(struct gdbstub *stub, unsigned long *args, int nargs, int *stop_idx)
static int isdigit(int character)
Check if character is a decimal digit.
static void gdbstub_write_regs(struct gdbstub *stub)
static void gdbstub_tx_packet(struct gdbstub *stub)
int errno
Global "last error" number.
static void gdbstub_read_regs(struct gdbstub *stub)
static int tolower(int character)
Convert character to lower case.
static uint8_t gdbstub_from_hex_digit(char ch)
static void gdbstub_breakpoint(struct gdbstub *stub)
char buf[SIZEOF_PAYLOAD+4]
#define cpu_to_le32(value)
static void gdbstub_send_errno(struct gdbstub *stub, int errno)
struct gdb_transport * trans
static struct gdbstub stub
void gdbstub_start(struct gdb_transport *trans)
Break into the debugger using the given transport.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
void gdbstub_handler(int signo, gdbreg_t *regs)
Interrupt handler.
static void gdbstub_write_mem(struct gdbstub *stub)
static void gdbstub_read_mem(struct gdbstub *stub)
static void gdbstub_send_ok(struct gdbstub *stub)
static void gdbstub_parse(struct gdbstub *stub, char ch)
static uint8_t gdbstub_to_hex_digit(uint8_t b)
int strcmp(const char *first, const char *second)
Compare strings.
static void gdbstub_rx_packet(struct gdbstub *stub)
size_t(* recv)(char *buf, size_t len)
Perform a blocking read.
#define cpu_to_le16(value)
static void gdbmach_set_pc(gdbreg_t *regs, gdbreg_t pc)
uint8_t data[48]
Additional event data.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static void gdbmach_set_single_step(gdbreg_t *regs, int step)
static void gdbstub_to_hex_buf(char *dst, char *src, int lenbytes)
void(* send)(const char *buf, size_t len)
Write, may block.
static void gdbstub_from_hex_buf(char *dst, char *src, int lenbytes)
#define NULL
NULL pointer (VOID *)
A transport mechanism for the GDB protocol.
static void gdbstub_state_new(struct gdbstub *stub, char ch)