GDB (xrefs)
Classes | Macros | Enumerations | Functions | Variables
/tmp/gdb-7.10/gdb/remote-mips.c File Reference
#include "defs.h"
#include "inferior.h"
#include "infrun.h"
#include "bfd.h"
#include "symfile.h"
#include "gdbcmd.h"
#include "gdbcore.h"
#include "serial.h"
#include "target.h"
#include <sys/stat.h>
#include "gdb_usleep.h"
#include "regcache.h"
#include <ctype.h>
#include "mips-tdep.h"
#include "gdbthread.h"
#include "gdb_bfd.h"

Go to the source code of this file.

Classes

struct  lsi_breakpoint_info
 
struct  lsi_error
 

Macros

#define SYN   '\026'
 
#define HDR_OFFSET   0x40
 
#define HDR_INDX_SYN   0
 
#define HDR_INDX_TYPE_LEN   1
 
#define HDR_INDX_LEN1   2
 
#define HDR_INDX_SEQ   3
 
#define HDR_LENGTH   4
 
#define TYPE_LEN_DA_BIT   0x20
 
#define TYPE_LEN_DATA   0
 
#define TYPE_LEN_ACK   TYPE_LEN_DA_BIT
 
#define HDR_SET_SYN(data, len, seq)   (SYN)
 
#define HDR_SET_TYPE_LEN(data, len, seq)
 
#define HDR_SET_LEN1(data, len, seq)   (HDR_OFFSET + ((len) & 0x3f))
 
#define HDR_SET_SEQ(data, len, seq)   (HDR_OFFSET + (seq))
 
#define HDR_CHECK(ch)   (((ch) & HDR_OFFSET) == HDR_OFFSET)
 
#define HDR_IS_DATA(hdr)   (((hdr)[HDR_INDX_TYPE_LEN] & TYPE_LEN_DA_BIT) == TYPE_LEN_DATA)
 
#define HDR_GET_LEN(hdr)   ((((hdr)[HDR_INDX_TYPE_LEN] & 0x1f) << 6) + (((hdr)[HDR_INDX_LEN1] & 0x3f)))
 
#define HDR_GET_SEQ(hdr)   ((unsigned int)(hdr)[HDR_INDX_SEQ] & 0x3f)
 
#define DATA_MAXLEN   1023
 
#define TRLR_OFFSET   HDR_OFFSET
 
#define TRLR_INDX_CSUM1   0
 
#define TRLR_INDX_CSUM2   1
 
#define TRLR_INDX_CSUM3   2
 
#define TRLR_LENGTH   3
 
#define TRLR_SET_CSUM1(cksum)   (TRLR_OFFSET + (((cksum) >> 12) & 0x3f))
 
#define TRLR_SET_CSUM2(cksum)   (TRLR_OFFSET + (((cksum) >> 6) & 0x3f))
 
#define TRLR_SET_CSUM3(cksum)   (TRLR_OFFSET + (((cksum) ) & 0x3f))
 
#define TRLR_CHECK(ch)   (((ch) & TRLR_OFFSET) == TRLR_OFFSET)
 
#define TRLR_GET_CKSUM(trlr)
 
#define SEQ_MODULOS   (64)
 
#define LOAD_CMD   "load -b -s tty0\r"
 
#define LOAD_CMD_UDP   "load -b -s udp\r"
 
#define MAX_LSI_BREAKPOINTS   256
 
#define W_WARN
 
#define W_MSK
 
#define W_VAL
 
#define W_QAL
 
#define E_ERR
 
#define E_BPT   0x200 /* error: No such breakpoint number */
 
#define E_RGE   0x201 /* error: Range is not supported */
 
#define E_QAL
 
#define E_OUT   0x203 /* error: Out of hardware resources */
 
#define E_NON   0x204 /* error: Hardware breakpoint not supported */
 
#define REGNO_OFFSET   96
 
#define DOETXACK   (1)
 
#define CHECKSIZE   (4 + 4 + 4 + 2)
 
#define BINCHUNK   (1024)
 
#define MAXRECSIZE   (550)
 

Enumerations

enum  break_type {
  BREAK_WRITE, BREAK_READ, BREAK_ACCESS, BREAK_FETCH,
  BREAK_UNUSED
}
 
enum  mips_monitor_type {
  MON_IDT, MON_PMON, MON_DDB, MON_LSI,
  MON_ROCKHOPPER, MON_LAST
}
 

Functions

static int mips_readchar (int timeout)
 
static int mips_receive_header (unsigned char *hdr, int *pgarbage, int ch, int timeout)
 
static int mips_receive_trailer (unsigned char *trlr, int *pgarbage, int *pch, int timeout)
 
static int mips_cksum (const unsigned char *hdr, const char *data, int len)
 
static void mips_send_packet (const char *s, int get_ack)
 
static void mips_send_command (const char *cmd, int prompt)
 
static int mips_receive_packet (char *buff, int throw_error, int timeout)
 
static ULONGEST mips_request (int cmd, ULONGEST addr, ULONGEST data, int *perr, int timeout, char *buff)
 
static void mips_initialize (void)
 
static void mips_close (struct target_ops *self)
 
static int mips_map_regno (struct gdbarch *, int)
 
static void mips_set_register (int regno, ULONGEST value)
 
static void mips_prepare_to_store (struct target_ops *self, struct regcache *regcache)
 
static int mips_fetch_word (CORE_ADDR addr, unsigned int *valp)
 
static int mips_store_word (CORE_ADDR addr, unsigned int value, int *old_contents)
 
static enum target_xfer_status mips_xfer_memory (gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
 
static void mips_files_info (struct target_ops *ignore)
 
static void mips_mourn_inferior (struct target_ops *ops)
 
static int pmon_makeb64 (unsigned long v, char *p, int n, unsigned int *chksum)
 
static int pmon_zeroset (int recsize, char **buff, unsigned int *amount, unsigned int *chksum)
 
static int pmon_checkset (int recsize, char **buff, unsigned int *value)
 
static void pmon_make_fastrec (char **outbuf, unsigned char *inbuf, int *inptr, int inamount, int *recsize, unsigned int *csum, unsigned int *zerofill)
 
static int pmon_check_ack (char *mesg)
 
static void pmon_start_download (void)
 
static void pmon_end_download (int final, int bintotal)
 
static void pmon_download (char *buffer, int length)
 
static void mips_load (struct target_ops *self, const char *file, int from_tty)
 
static int mips_make_srec (char *buffer, int type, CORE_ADDR memaddr, unsigned char *myaddr, int len)
 
static int mips_set_breakpoint (CORE_ADDR addr, int len, enum break_type type)
 
static int mips_clear_breakpoint (CORE_ADDR addr, int len, enum break_type type)
 
static int mips_common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type)
 
static void close_ports (void)
 
static void ATTRIBUTE_NORETURN mips_error (char *string,...)
 
static void fputc_readable (int ch, struct ui_file *file)
 
static void fputs_readable (const char *string, struct ui_file *file)
 
static int read_hex_value (const char *p, ULONGEST *result)
 
static int mips_expect_timeout (const char *string, int timeout)
 
static int mips_expect (const char *string)
 
static void mips_initialize_cleanups (void *arg)
 
static void mips_exit_cleanups (void *arg)
 
static void mips_enter_debug (void)
 
static int mips_exit_debug (void)
 
static void common_open (struct target_ops *ops, const char *name, int from_tty, enum mips_monitor_type new_monitor, const char *new_monitor_prompt)
 
static void mips_open (const char *name, int from_tty)
 
static void pmon_open (const char *name, int from_tty)
 
static void ddb_open (const char *name, int from_tty)
 
static void rockhopper_open (const char *name, int from_tty)
 
static void lsi_open (const char *name, int from_tty)
 
static void mips_detach (struct target_ops *ops, const char *args, int from_tty)
 
static void mips_resume (struct target_ops *ops, ptid_t ptid, int step, enum gdb_signal siggnal)
 
static enum gdb_signal mips_signal_from_protocol (int sig)
 
static ptid_t mips_wait (struct target_ops *ops, ptid_t ptid, struct target_waitstatus *status, int options)
 
static void mips_fetch_registers (struct target_ops *ops, struct regcache *regcache, int regno)
 
static void mips_store_registers (struct target_ops *ops, struct regcache *regcache, int regno)
 
static enum target_xfer_status mips_xfer_partial (struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
 
static void mips_kill (struct target_ops *ops)
 
static void mips_create_inferior (struct target_ops *ops, char *execfile, char *args, char **env, int from_tty)
 
static int mips_insert_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
 
static int mips_remove_breakpoint (struct target_ops *ops, struct gdbarch *gdbarch, struct bp_target_info *bp_tgt)
 
static int mips_can_use_watchpoint (struct target_ops *self, int type, int cnt, int othertype)
 
static unsigned long calculate_mask (CORE_ADDR addr, int len)
 
static int mips_insert_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, int type, struct expression *cond)
 
static int mips_remove_watchpoint (struct target_ops *self, CORE_ADDR addr, int len, int type, struct expression *cond)
 
static int mips_stopped_by_watchpoint (struct target_ops *ops)
 
static int mips_check_lsi_error (CORE_ADDR addr, int rerrflg)
 
static void send_srec (char *srec, int len, CORE_ADDR addr)
 
static void mips_load_srec (const char *args)
 
static int mips_expect_download (char *string)
 
static void pmon_check_entry_address (char *entry_address, int final)
 
static int pmon_check_total (int bintotal)
 
static void pmon_load_fast (const char *file)
 
static int mips_thread_alive (struct target_ops *ops, ptid_t ptid)
 
static char * mips_pid_to_str (struct target_ops *ops, ptid_t ptid)
 
static void pmon_command (char *args, int from_tty)
 
void _initialize_remote_mips (void)
 

Variables

struct target_ops mips_ops
 
struct target_ops pmon_ops
 
struct target_ops ddb_ops
 
struct target_ops rockhopper_ops
 
struct target_ops mips_ops pmon_ops ddb_ops rockhopper_ops lsi_ops
 
static enum mips_monitor_type mips_monitor = MON_LAST
 
static char * mips_monitor_prompt
 
static int mips_is_open
 
static struct target_opscurrent_ops
 
static int mips_initializing
 
static int mips_exiting
 
static unsigned int mips_send_seq
 
static unsigned int mips_receive_seq
 
static int mips_retransmit_wait = 3
 
static int mips_send_retries = 10
 
static int mips_syn_garbage = 10
 
static int mips_receive_wait = 5
 
static int mips_need_reply = 0
 
static struct serialmips_desc
 
static struct serialudp_desc
 
static int udp_in_use
 
static char * tftp_name
 
static char * tftp_localname
 
static int tftp_in_use
 
static FILE * tftp_file
 
static int interrupt_count
 
static int mips_wait_flag = 0
 
static int monitor_supports_breakpoints = 0
 
static int hit_watchpoint
 
struct lsi_breakpoint_info lsi_breakpoints [MAX_LSI_BREAKPOINTS]
 
struct lsi_error lsi_warning_table []
 
struct lsi_error lsi_error_table []
 
static int monitor_warnings
 
static ptid_t remote_mips_ptid
 
static int mask_address_p = 1
 
static char encoding []
 
initialize_file_ftype _initialize_remote_mips
 

Macro Definition Documentation

#define BINCHUNK   (1024)

Definition at line 3094 of file remote-mips.c.

Referenced by pmon_load_fast().

#define CHECKSIZE   (4 + 4 + 4 + 2)

Definition at line 3089 of file remote-mips.c.

Referenced by pmon_load_fast(), and pmon_make_fastrec().

#define DATA_MAXLEN   1023
#define DOETXACK   (1)

Definition at line 2964 of file remote-mips.c.

#define E_BPT   0x200 /* error: No such breakpoint number */

Definition at line 413 of file remote-mips.c.

#define E_ERR
Value:
0x200 /* This bit is set if the error code
is an error */

Definition at line 411 of file remote-mips.c.

#define E_NON   0x204 /* error: Hardware breakpoint not supported */

Definition at line 418 of file remote-mips.c.

#define E_OUT   0x203 /* error: Out of hardware resources */

Definition at line 417 of file remote-mips.c.

#define E_QAL
Value:
0x202 /* error: The requested qualifiers can
not be used */

Definition at line 415 of file remote-mips.c.

#define E_RGE   0x201 /* error: Range is not supported */

Definition at line 414 of file remote-mips.c.

#define HDR_CHECK (   ch)    (((ch) & HDR_OFFSET) == HDR_OFFSET)

Definition at line 236 of file remote-mips.c.

Referenced by mips_receive_header().

#define HDR_GET_LEN (   hdr)    ((((hdr)[HDR_INDX_TYPE_LEN] & 0x1f) << 6) + (((hdr)[HDR_INDX_LEN1] & 0x3f)))

Definition at line 242 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define HDR_GET_SEQ (   hdr)    ((unsigned int)(hdr)[HDR_INDX_SEQ] & 0x3f)

Definition at line 244 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define HDR_INDX_LEN1   2

Definition at line 217 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define HDR_INDX_SEQ   3

Definition at line 218 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define HDR_INDX_SYN   0

Definition at line 215 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define HDR_INDX_TYPE_LEN   1

Definition at line 216 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define HDR_IS_DATA (   hdr)    (((hdr)[HDR_INDX_TYPE_LEN] & TYPE_LEN_DA_BIT) == TYPE_LEN_DATA)

Definition at line 240 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define HDR_LENGTH   4
#define HDR_OFFSET   0x40

Definition at line 212 of file remote-mips.c.

#define HDR_SET_LEN1 (   data,
  len,
  seq 
)    (HDR_OFFSET + ((len) & 0x3f))

Definition at line 232 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define HDR_SET_SEQ (   data,
  len,
  seq 
)    (HDR_OFFSET + (seq))

Definition at line 233 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define HDR_SET_SYN (   data,
  len,
  seq 
)    (SYN)

Definition at line 227 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define HDR_SET_TYPE_LEN (   data,
  len,
  seq 
)
Value:
+ ((data) ? TYPE_LEN_DATA : TYPE_LEN_ACK) \
+ (((len) >> 6) & 0x1f))
#define HDR_OFFSET
Definition: remote-mips.c:212
#define TYPE_LEN_ACK
Definition: remote-mips.c:224
#define TYPE_LEN_DATA
Definition: remote-mips.c:223
const ULONGEST const LONGEST len
Definition: target.h:309

Definition at line 228 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define LOAD_CMD   "load -b -s tty0\r"

Definition at line 277 of file remote-mips.c.

Referenced by init_ppc_cmds(), mips_load_srec(), and pmon_start_download().

#define LOAD_CMD_UDP   "load -b -s udp\r"

Definition at line 278 of file remote-mips.c.

Referenced by pmon_start_download().

#define MAX_LSI_BREAKPOINTS   256
#define MAXRECSIZE   (550)

Definition at line 3097 of file remote-mips.c.

Referenced by pmon_load_fast(), and pmon_make_fastrec().

#define REGNO_OFFSET   96

Definition at line 1976 of file remote-mips.c.

Referenced by mips_map_regno().

#define SEQ_MODULOS   (64)

Definition at line 274 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define SYN   '\026'

Definition at line 207 of file remote-mips.c.

Referenced by mips_receive_header(), mips_receive_packet(), and mips_send_packet().

#define TRLR_CHECK (   ch)    (((ch) & TRLR_OFFSET) == TRLR_OFFSET)

Definition at line 264 of file remote-mips.c.

Referenced by mips_receive_trailer().

#define TRLR_GET_CKSUM (   trlr)
Value:
((((trlr)[TRLR_INDX_CSUM1] & 0x3f) << 12) \
+ (((trlr)[TRLR_INDX_CSUM2] & 0x3f) << 6) \
+ ((trlr)[TRLR_INDX_CSUM3] & 0x3f))
#define TRLR_INDX_CSUM3
Definition: remote-mips.c:255
#define TRLR_INDX_CSUM1
Definition: remote-mips.c:253
#define TRLR_INDX_CSUM2
Definition: remote-mips.c:254

Definition at line 268 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define TRLR_INDX_CSUM1   0

Definition at line 253 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define TRLR_INDX_CSUM2   1

Definition at line 254 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define TRLR_INDX_CSUM3   2

Definition at line 255 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define TRLR_LENGTH   3

Definition at line 256 of file remote-mips.c.

Referenced by mips_receive_packet(), mips_receive_trailer(), and mips_send_packet().

#define TRLR_OFFSET   HDR_OFFSET

Definition at line 250 of file remote-mips.c.

#define TRLR_SET_CSUM1 (   cksum)    (TRLR_OFFSET + (((cksum) >> 12) & 0x3f))

Definition at line 259 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define TRLR_SET_CSUM2 (   cksum)    (TRLR_OFFSET + (((cksum) >> 6) & 0x3f))

Definition at line 260 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define TRLR_SET_CSUM3 (   cksum)    (TRLR_OFFSET + (((cksum) ) & 0x3f))

Definition at line 261 of file remote-mips.c.

Referenced by mips_receive_packet(), and mips_send_packet().

#define TYPE_LEN_ACK   TYPE_LEN_DA_BIT

Definition at line 224 of file remote-mips.c.

#define TYPE_LEN_DA_BIT   0x20

Definition at line 222 of file remote-mips.c.

#define TYPE_LEN_DATA   0

Definition at line 223 of file remote-mips.c.

#define W_MSK
Value:
0x101 /* warning: Range feature is supported
via mask */

Definition at line 404 of file remote-mips.c.

#define W_QAL
Value:
0x104 /* warning: Requested qualifiers are
not supported in hardware */

Definition at line 408 of file remote-mips.c.

#define W_VAL
Value:
0x102 /* warning: Value check is not
supported in hardware */

Definition at line 406 of file remote-mips.c.

#define W_WARN
Value:
0x100 /* This bit is set if the error code
is a warning */

Definition at line 402 of file remote-mips.c.

Referenced by mips_check_lsi_error().

Enumeration Type Documentation

enum break_type
Enumerator
BREAK_WRITE 
BREAK_READ 
BREAK_ACCESS 
BREAK_FETCH 
BREAK_UNUSED 

Definition at line 45 of file remote-mips.c.

Enumerator
MON_IDT 
MON_PMON 
MON_DDB 
MON_LSI 
MON_ROCKHOPPER 
MON_LAST 

Definition at line 286 of file remote-mips.c.

Function Documentation

void _initialize_remote_mips ( void  )

Definition at line 3626 of file remote-mips.c.

References _, add_com(), add_setshow_boolean_cmd(), add_setshow_string_cmd(), add_setshow_zinteger_cmd(), add_target(), class_obscure, ddb_open(), ddb_ops, default_child_has_all_memory(), default_child_has_execution(), default_child_has_memory(), default_child_has_registers(), default_child_has_stack(), lsi_open(), lsi_ops, mask_address_p, mips_can_use_watchpoint(), mips_close(), mips_create_inferior(), mips_detach(), mips_fetch_registers(), mips_files_info(), mips_insert_breakpoint(), mips_insert_watchpoint(), mips_kill(), mips_load(), mips_monitor_prompt, mips_mourn_inferior(), mips_open(), mips_ops, mips_pid_to_str(), mips_prepare_to_store(), mips_receive_wait, mips_remove_breakpoint(), mips_remove_watchpoint(), mips_resume(), mips_retransmit_wait, mips_stopped_by_watchpoint(), mips_store_registers(), mips_syn_garbage, mips_thread_alive(), mips_wait(), mips_xfer_partial(), monitor_warnings, no_class, OPS_MAGIC, pmon_command(), pmon_open(), pmon_ops, process_stratum, ptid_build(), rockhopper_open(), rockhopper_ops, serial_log_command(), setlist, showlist, target_ops::to_can_use_hw_breakpoint, target_ops::to_close, target_ops::to_create_inferior, target_ops::to_detach, target_ops::to_doc, target_ops::to_fetch_registers, target_ops::to_files_info, target_ops::to_has_all_memory, target_ops::to_has_execution, target_ops::to_has_memory, target_ops::to_has_registers, target_ops::to_has_stack, target_ops::to_insert_breakpoint, target_ops::to_insert_watchpoint, target_ops::to_kill, target_ops::to_load, target_ops::to_log_command, target_ops::to_longname, target_ops::to_magic, target_ops::to_mourn_inferior, target_ops::to_open, target_ops::to_pid_to_str, target_ops::to_prepare_to_store, target_ops::to_remove_breakpoint, target_ops::to_remove_watchpoint, target_ops::to_resume, target_ops::to_shortname, target_ops::to_stopped_by_watchpoint, target_ops::to_store_registers, target_ops::to_stratum, target_ops::to_thread_alive, target_ops::to_wait, and target_ops::to_xfer_partial.

static unsigned long calculate_mask ( CORE_ADDR  addr,
int  len 
)
static

Definition at line 2415 of file remote-mips.c.

References gdb.printing::long.

Referenced by mips_common_breakpoint().

static void close_ports ( void  )
static

Definition at line 458 of file remote-mips.c.

References mips_is_open, serial_close(), tftp_in_use, and udp_in_use.

Referenced by mips_close(), mips_error(), and mips_kill().

static void common_open ( struct target_ops ops,
const char *  name,
int  from_tty,
enum mips_monitor_type  new_monitor,
const char *  new_monitor_prompt 
)
static
static void ddb_open ( const char *  name,
int  from_tty 
)
static

Definition at line 1695 of file remote-mips.c.

References common_open(), ddb_ops, and MON_DDB.

Referenced by _initialize_remote_mips().

static void fputc_readable ( int  ch,
struct ui_file file 
)
static
static void fputs_readable ( const char *  string,
struct ui_file file 
)
static

Definition at line 527 of file remote-mips.c.

References fputc_readable().

Referenced by mips_expect_timeout().

static void lsi_open ( const char *  name,
int  from_tty 
)
static
static int mips_can_use_watchpoint ( struct target_ops self,
int  type,
int  cnt,
int  othertype 
)
static

Definition at line 2404 of file remote-mips.c.

References MAX_LSI_BREAKPOINTS, and target_shortname.

Referenced by _initialize_remote_mips().

static int mips_check_lsi_error ( CORE_ADDR  addr,
int  rerrflg 
)
static
static int mips_cksum ( const unsigned char *  hdr,
const char *  data,
int  len 
)
static

Definition at line 818 of file remote-mips.c.

References HDR_LENGTH, and len.

Referenced by mips_receive_packet(), and mips_send_packet().

static int mips_clear_breakpoint ( CORE_ADDR  addr,
int  len,
enum break_type  type 
)
static
static void mips_close ( struct target_ops self)
static
static int mips_common_breakpoint ( int  set,
CORE_ADDR  addr,
int  len,
enum break_type  type 
)
static
static void mips_create_inferior ( struct target_ops ops,
char *  execfile,
char *  args,
char **  env,
int  from_tty 
)
static
static void mips_detach ( struct target_ops ops,
const char *  args,
int  from_tty 
)
static

Definition at line 1741 of file remote-mips.c.

References _, error(), printf_unfiltered(), and unpush_target().

Referenced by _initialize_remote_mips().

static void mips_enter_debug ( void  )
static
static void ATTRIBUTE_NORETURN mips_error ( char *  string,
  ... 
)
static
static void mips_exit_cleanups ( void *  arg)
static

Definition at line 1310 of file remote-mips.c.

References mips_exiting.

Referenced by mips_exit_debug().

static int mips_exit_debug ( void  )
static
static int mips_expect ( const char *  string)
static
static int mips_expect_download ( char *  string)
static
static int mips_expect_timeout ( const char *  string,
int  timeout 
)
static
static void mips_fetch_registers ( struct target_ops ops,
struct regcache regcache,
int  regno 
)
static
static int mips_fetch_word ( CORE_ADDR  addr,
unsigned int valp 
)
static

Definition at line 2094 of file remote-mips.c.

References err, mips_receive_wait, and mips_request().

Referenced by mips_xfer_memory().

static void mips_files_info ( struct target_ops ignore)
static

Definition at line 2261 of file remote-mips.c.

References printf_unfiltered().

Referenced by _initialize_remote_mips().

static void mips_initialize ( void  )
static
static void mips_initialize_cleanups ( void *  arg)
static

Definition at line 1302 of file remote-mips.c.

References mips_initializing.

Referenced by mips_initialize().

static int mips_insert_breakpoint ( struct target_ops ops,
struct gdbarch gdbarch,
struct bp_target_info bp_tgt 
)
static
static int mips_insert_watchpoint ( struct target_ops self,
CORE_ADDR  addr,
int  len,
int  type,
struct expression cond 
)
static

Definition at line 2439 of file remote-mips.c.

References mips_set_breakpoint().

Referenced by _initialize_remote_mips().

static void mips_kill ( struct target_ops ops)
static
static void mips_load ( struct target_ops self,
const char *  file,
int  from_tty 
)
static
static void mips_load_srec ( const char *  args)
static
static int mips_make_srec ( char *  buffer,
int  type,
CORE_ADDR  memaddr,
unsigned char *  myaddr,
int  len 
)
static

Definition at line 2926 of file remote-mips.c.

References type.

Referenced by mips_initialize(), and mips_load_srec().

static int mips_map_regno ( struct gdbarch gdbarch,
int  regno 
)
static

Definition at line 1979 of file remote-mips.c.

References mips_regnum::fp0, mips_regnum(), and REGNO_OFFSET.

Referenced by mips_fetch_registers(), and mips_store_registers().

static void mips_mourn_inferior ( struct target_ops ops)
static

Definition at line 2356 of file remote-mips.c.

References unpush_target().

Referenced by _initialize_remote_mips().

static void mips_open ( const char *  name,
int  from_tty 
)
static
static char* mips_pid_to_str ( struct target_ops ops,
ptid_t  ptid 
)
static

Definition at line 3588 of file remote-mips.c.

References normal_pid_to_str(), ptid_equal(), and xsnprintf().

Referenced by _initialize_remote_mips().

static void mips_prepare_to_store ( struct target_ops self,
struct regcache regcache 
)
static

Definition at line 2058 of file remote-mips.c.

Referenced by _initialize_remote_mips().

static int mips_readchar ( int  timeout)
static
static int mips_receive_header ( unsigned char *  hdr,
int pgarbage,
int  ch,
int  timeout 
)
static
static int mips_receive_packet ( char *  buff,
int  throw_error,
int  timeout 
)
static
static int mips_receive_trailer ( unsigned char *  trlr,
int pgarbage,
int pch,
int  timeout 
)
static

Definition at line 795 of file remote-mips.c.

References mips_readchar(), SERIAL_TIMEOUT, TRLR_CHECK, and TRLR_LENGTH.

Referenced by mips_receive_packet(), and mips_send_packet().

static int mips_remove_breakpoint ( struct target_ops ops,
struct gdbarch gdbarch,
struct bp_target_info bp_tgt 
)
static
static int mips_remove_watchpoint ( struct target_ops self,
CORE_ADDR  addr,
int  len,
int  type,
struct expression cond 
)
static

Definition at line 2452 of file remote-mips.c.

References mips_clear_breakpoint().

Referenced by _initialize_remote_mips().

static ULONGEST mips_request ( int  cmd,
ULONGEST  addr,
ULONGEST  data,
int perr,
int  timeout,
char *  buff 
)
static
static void mips_resume ( struct target_ops ops,
ptid_t  ptid,
int  step,
enum gdb_signal  siggnal 
)
static

Definition at line 1757 of file remote-mips.c.

References err, mips_monitor, mips_receive_wait, mips_request(), and MON_LSI.

Referenced by _initialize_remote_mips().

static void mips_send_command ( const char *  cmd,
int  prompt 
)
static
static void mips_send_packet ( const char *  s,
int  get_ack 
)
static
static int mips_set_breakpoint ( CORE_ADDR  addr,
int  len,
enum break_type  type 
)
static

Definition at line 2475 of file remote-mips.c.

References mips_common_breakpoint().

Referenced by mips_insert_breakpoint(), and mips_insert_watchpoint().

static void mips_set_register ( int  regno,
ULONGEST  value 
)
static
static enum gdb_signal mips_signal_from_protocol ( int  sig)
static

Definition at line 1773 of file remote-mips.c.

Referenced by mips_wait().

static int mips_stopped_by_watchpoint ( struct target_ops ops)
static

Definition at line 2466 of file remote-mips.c.

References hit_watchpoint.

Referenced by _initialize_remote_mips().

static void mips_store_registers ( struct target_ops ops,
struct regcache regcache,
int  regno 
)
static
static int mips_store_word ( CORE_ADDR  addr,
unsigned int  value,
int old_contents 
)
static

Definition at line 2114 of file remote-mips.c.

References err, mips_receive_wait, and mips_request().

Referenced by mips_xfer_memory().

static int mips_thread_alive ( struct target_ops ops,
ptid_t  ptid 
)
static

Definition at line 3575 of file remote-mips.c.

References ptid_equal().

Referenced by _initialize_remote_mips().

static ptid_t mips_wait ( struct target_ops ops,
ptid_t  ptid,
struct target_waitstatus status,
int  options 
)
static
static enum target_xfer_status mips_xfer_memory ( gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  memaddr,
ULONGEST  len,
ULONGEST xfered_len 
)
static
static enum target_xfer_status mips_xfer_partial ( struct target_ops ops,
enum target_object  object,
const char *  annex,
gdb_byte readbuf,
const gdb_byte writebuf,
ULONGEST  offset,
ULONGEST  len,
ULONGEST xfered_len 
)
static
static int pmon_check_ack ( char *  mesg)
static
static void pmon_check_entry_address ( char *  entry_address,
int  final 
)
static

Definition at line 3263 of file remote-mips.c.

References mips_expect(), mips_expect_timeout(), remote_timeout, and tftp_in_use.

Referenced by pmon_end_download().

static int pmon_check_total ( int  bintotal)
static

Definition at line 3278 of file remote-mips.c.

References mips_expect(), and mips_expect_download().

Referenced by pmon_end_download().

static int pmon_checkset ( int  recsize,
char **  buff,
unsigned int value 
)
static

Definition at line 3072 of file remote-mips.c.

References pmon_makeb64().

Referenced by pmon_load_fast().

static void pmon_command ( char *  args,
int  from_tty 
)
static
static void pmon_download ( char *  buffer,
int  length 
)
static

Definition at line 3366 of file remote-mips.c.

References perror_with_name(), serial_write(), tftp_file, tftp_in_use, tftp_localname, and udp_in_use.

Referenced by pmon_load_fast().

static void pmon_end_download ( int  final,
int  bintotal 
)
static
static void pmon_load_fast ( const char *  file)
static
static void pmon_make_fastrec ( char **  outbuf,
unsigned char *  inbuf,
int inptr,
int  inamount,
int recsize,
unsigned int csum,
unsigned int zerofill 
)
static

Definition at line 3128 of file remote-mips.c.

References CHECKSIZE, MAXRECSIZE, pmon_makeb64(), and pmon_zeroset().

Referenced by pmon_load_fast().

static int pmon_makeb64 ( unsigned long  v,
char *  p,
int  n,
unsigned int chksum 
)
static
static void pmon_open ( const char *  name,
int  from_tty 
)
static

Definition at line 1687 of file remote-mips.c.

References common_open(), MON_PMON, and pmon_ops.

Referenced by _initialize_remote_mips().

static void pmon_start_download ( void  )
static
static int pmon_zeroset ( int  recsize,
char **  buff,
unsigned int amount,
unsigned int chksum 
)
static

Definition at line 3045 of file remote-mips.c.

References pmon_makeb64().

Referenced by pmon_load_fast(), and pmon_make_fastrec().

static int read_hex_value ( const char *  p,
ULONGEST result 
)
static

Definition at line 540 of file remote-mips.c.

Referenced by mips_request(), and mips_wait().

static void rockhopper_open ( const char *  name,
int  from_tty 
)
static

Definition at line 1703 of file remote-mips.c.

References common_open(), MON_ROCKHOPPER, and rockhopper_ops.

Referenced by _initialize_remote_mips().

static void send_srec ( char *  srec,
int  len,
CORE_ADDR  addr 
)
static

Variable Documentation

initialize_file_ftype _initialize_remote_mips
struct target_ops* current_ops
static

Definition at line 322 of file remote-mips.c.

struct target_ops ddb_ops
char encoding[]
static
int hit_watchpoint
static

Definition at line 384 of file remote-mips.c.

Referenced by mips_stopped_by_watchpoint(), and mips_wait().

int interrupt_count
static

Definition at line 369 of file remote-mips.c.

Referenced by mips_kill(), and mips_wait().

struct lsi_breakpoint_info lsi_breakpoints[MAX_LSI_BREAKPOINTS]
struct lsi_error lsi_error_table[]
Initial value:
=
{
{E_BPT, "No such breakpoint number"},
{E_RGE, "Range is not supported"},
{E_QAL, "The requested qualifiers can not be used"},
{E_OUT, "Out of hardware resources"},
{E_NON, "Hardware breakpoint not supported"},
{0, NULL}
}
#define E_OUT
Definition: remote-mips.c:417
#define E_BPT
Definition: remote-mips.c:413
#define E_QAL
Definition: remote-mips.c:415
#define E_RGE
Definition: remote-mips.c:414
#define E_NON
Definition: remote-mips.c:418

Definition at line 434 of file remote-mips.c.

Definition at line 284 of file remote-mips.c.

Referenced by _initialize_remote_mips(), and lsi_open().

struct lsi_error lsi_warning_table[]
Initial value:
=
{
{W_MSK, "Range feature is supported via mask"},
{W_VAL, "Value check is not supported in hardware"},
{W_QAL, "Requested qualifiers are not supported in hardware"},
{0, NULL}
}
#define W_VAL
Definition: remote-mips.c:406
#define W_MSK
Definition: remote-mips.c:404
#define W_QAL
Definition: remote-mips.c:408

Definition at line 426 of file remote-mips.c.

int mask_address_p = 1
static

Definition at line 2140 of file remote-mips.c.

Referenced by _initialize_remote_mips(), and mips_xfer_memory().

struct serial* mips_desc
static

Definition at line 354 of file remote-mips.c.

int mips_exiting
static

Definition at line 328 of file remote-mips.c.

Referenced by mips_exit_cleanups(), mips_exit_debug(), and mips_readchar().

int mips_initializing
static
int mips_is_open
static

Definition at line 319 of file remote-mips.c.

Referenced by close_ports(), common_open(), mips_close(), and mips_kill().

enum mips_monitor_type mips_monitor = MON_LAST
static
char* mips_monitor_prompt
static
int mips_need_reply = 0
static

Definition at line 351 of file remote-mips.c.

Referenced by mips_exit_debug(), mips_readchar(), mips_request(), and mips_wait().

struct target_ops mips_ops
unsigned int mips_receive_seq
static

Definition at line 334 of file remote-mips.c.

Referenced by mips_enter_debug(), and mips_receive_packet().

int mips_receive_wait = 5
static
int mips_retransmit_wait = 3
static

Definition at line 337 of file remote-mips.c.

Referenced by _initialize_remote_mips(), and mips_send_packet().

int mips_send_retries = 10
static

Definition at line 340 of file remote-mips.c.

Referenced by mips_send_packet().

unsigned int mips_send_seq
static

Definition at line 331 of file remote-mips.c.

Referenced by mips_enter_debug(), and mips_send_packet().

int mips_syn_garbage = 10
static

Definition at line 344 of file remote-mips.c.

Referenced by _initialize_remote_mips(), and mips_receive_header().

int mips_wait_flag = 0
static

Definition at line 372 of file remote-mips.c.

Referenced by mips_initialize(), mips_kill(), and mips_wait().

int monitor_supports_breakpoints = 0
static

Definition at line 375 of file remote-mips.c.

Referenced by mips_initialize(), mips_insert_breakpoint(), and mips_remove_breakpoint().

int monitor_warnings
static

Definition at line 446 of file remote-mips.c.

Referenced by _initialize_remote_mips(), and mips_check_lsi_error().

struct target_ops pmon_ops
ptid_t remote_mips_ptid
static

Definition at line 452 of file remote-mips.c.

Referenced by common_open().

struct target_ops rockhopper_ops
FILE* tftp_file
static

Definition at line 365 of file remote-mips.c.

Referenced by pmon_download(), pmon_end_download(), and pmon_start_download().

int tftp_in_use
static
char* tftp_localname
static
char* tftp_name
static

Definition at line 362 of file remote-mips.c.

Referenced by common_open(), and pmon_end_download().

struct serial* udp_desc
static

Definition at line 357 of file remote-mips.c.

int udp_in_use
static