SimAVR
AVR Simulator
sim_gdb.c File Reference
#include <errno.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <unistd.h>
#include "avr_eeprom.h"
#include "sim_avr.h"
#include "sim_core.h"
#include "sim_gdb.h"
#include "sim_hex.h"
#include "sim_network.h"
Include dependency graph for sim_gdb.c:

Data Structures

struct  avr_gdb_watchpoints_t
 
struct  avr_gdb_t
 

Macros

#define DBG(w)
 
#define WATCH_LIMIT   (32)
 

Typedefs

typedef struct avr_gdb_t avr_gdb_t
 

Functions

static int gdb_watch_find (const avr_gdb_watchpoints_t *w, uint32_t addr)
 Returns the index of the watchpoint if found, -1 otherwise. More...
 
static int gdb_watch_find_range (const avr_gdb_watchpoints_t *w, uint32_t addr)
 Contrary to gdb_watch_find, this actually checks the address against a watched memory range. More...
 
static int gdb_watch_add_or_update (avr_gdb_watchpoints_t *w, enum avr_gdb_watch_type kind, uint32_t addr, uint32_t size)
 Returns -1 on error, 0 otherwise. More...
 
static int gdb_watch_rm (avr_gdb_watchpoints_t *w, enum avr_gdb_watch_type kind, uint32_t addr)
 Returns -1 on error or if the specified point does not exist, 0 otherwise. More...
 
static void gdb_watch_clear (avr_gdb_watchpoints_t *w)
 
static void gdb_send_reply (avr_gdb_t *g, char *cmd)
 
static void gdb_send_quick_status (avr_gdb_t *g, uint8_t signal)
 
static int gdb_change_breakpoint (avr_gdb_watchpoints_t *w, int set, enum avr_gdb_watch_type kind, uint32_t addr, uint32_t size)
 
static int gdb_write_register (avr_gdb_t *g, int regi, uint8_t *src)
 
static int gdb_read_register (avr_gdb_t *g, int regi, char *rep)
 
static void gdb_handle_command (avr_gdb_t *g, char *cmd)
 
static int gdb_network_handler (avr_gdb_t *g, uint32_t dosleep)
 
void avr_gdb_handle_watchpoints (avr_t *avr, uint16_t addr, enum avr_gdb_watch_type type)
 If an applicable watchpoint exists for addr, stop the cpu and send a status report. More...
 
int avr_gdb_processor (avr_t *avr, int sleep)
 Call from the main AVR decoder thread. More...
 
int avr_gdb_init (avr_t *avr)
 Initialise GDB. More...
 
void avr_deinit_gdb (avr_t *avr)
 

Macro Definition Documentation

#define DBG (   w)
#define WATCH_LIMIT   (32)

Typedef Documentation

typedef struct avr_gdb_t avr_gdb_t

Function Documentation

static int gdb_change_breakpoint ( avr_gdb_watchpoints_t w,
int  set,
enum avr_gdb_watch_type  kind,
uint32_t  addr,
uint32_t  size 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void gdb_handle_command ( avr_gdb_t g,
char *  cmd 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int gdb_network_handler ( avr_gdb_t g,
uint32_t  dosleep 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static int gdb_read_register ( avr_gdb_t g,
int  regi,
char *  rep 
)
static

Here is the caller graph for this function:

static void gdb_send_quick_status ( avr_gdb_t g,
uint8_t  signal 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static void gdb_send_reply ( avr_gdb_t g,
char *  cmd 
)
static

Here is the caller graph for this function:

static int gdb_watch_add_or_update ( avr_gdb_watchpoints_t w,
enum avr_gdb_watch_type  kind,
uint32_t  addr,
uint32_t  size 
)
static

Returns -1 on error, 0 otherwise.

Here is the call graph for this function:

Here is the caller graph for this function:

static void gdb_watch_clear ( avr_gdb_watchpoints_t w)
static

Here is the caller graph for this function:

static int gdb_watch_find ( const avr_gdb_watchpoints_t w,
uint32_t  addr 
)
static

Returns the index of the watchpoint if found, -1 otherwise.

Here is the caller graph for this function:

static int gdb_watch_find_range ( const avr_gdb_watchpoints_t w,
uint32_t  addr 
)
static

Contrary to gdb_watch_find, this actually checks the address against a watched memory range.

Here is the caller graph for this function:

static int gdb_watch_rm ( avr_gdb_watchpoints_t w,
enum avr_gdb_watch_type  kind,
uint32_t  addr 
)
static

Returns -1 on error or if the specified point does not exist, 0 otherwise.

Here is the call graph for this function:

Here is the caller graph for this function:

static int gdb_write_register ( avr_gdb_t g,
int  regi,
uint8_t *  src 
)
static

Here is the caller graph for this function: