diff options
author | Maciej W. Rozycki <macro@linux-mips.org> | 2008-02-06 09:37:56 +0000 |
---|---|---|
committer | Maciej W. Rozycki <macro@linux-mips.org> | 2008-02-06 09:37:56 +0000 |
commit | 06b1d59cd626db8764130ba2a03daa42feefc968 (patch) | |
tree | b0d2006597a765971bdaca1e77e2ea9645e315c4 /gdb/remote-mips.c | |
parent | 6ec62a9bd3603587c34dbb54d2317a2cdea8f672 (diff) | |
download | gdb-06b1d59cd626db8764130ba2a03daa42feefc968.zip gdb-06b1d59cd626db8764130ba2a03daa42feefc968.tar.gz gdb-06b1d59cd626db8764130ba2a03daa42feefc968.tar.bz2 |
* remote-mips.c (set_breakpoint): Rename to...
(mips_set_breakpoint): ... this.
(clear_breakpoint): Rename to...
(mips_clear_breakpoint): ... this.
(common_breakpoint): Rename to...
(mips_common_breakpoint): ... this.
(check_lsi_error): Rename to...
(mips_check_lsi_error): ... this.
Diffstat (limited to 'gdb/remote-mips.c')
-rw-r--r-- | gdb/remote-mips.c | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/gdb/remote-mips.c b/gdb/remote-mips.c index 244df5a..3cbf8a0 100644 --- a/gdb/remote-mips.c +++ b/gdb/remote-mips.c @@ -140,12 +140,13 @@ static void mips_load (char *file, int from_tty); static int mips_make_srec (char *buffer, int type, CORE_ADDR memaddr, unsigned char *myaddr, int len); -static int set_breakpoint (CORE_ADDR addr, int len, enum break_type type); +static int mips_set_breakpoint (CORE_ADDR addr, int len, enum break_type type); -static int clear_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 common_breakpoint (int set, 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); /* Forward declarations. */ extern struct target_ops mips_ops; @@ -1450,7 +1451,7 @@ mips_initialize (void) /* Clear all breakpoints: */ if ((mips_monitor == MON_IDT - && clear_breakpoint (-1, 0, BREAK_UNUSED) == 0) + && mips_clear_breakpoint (-1, 0, BREAK_UNUSED) == 0) || mips_monitor == MON_LSI) monitor_supports_breakpoints = 1; else @@ -2236,8 +2237,8 @@ static int mips_insert_breakpoint (struct bp_target_info *bp_tgt) { if (monitor_supports_breakpoints) - return set_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE, - BREAK_FETCH); + return mips_set_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE, + BREAK_FETCH); else return memory_insert_breakpoint (bp_tgt); } @@ -2246,8 +2247,8 @@ static int mips_remove_breakpoint (struct bp_target_info *bp_tgt) { if (monitor_supports_breakpoints) - return clear_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE, - BREAK_FETCH); + return mips_clear_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE, + BREAK_FETCH); else return memory_remove_breakpoint (bp_tgt); } @@ -2293,7 +2294,7 @@ calculate_mask (CORE_ADDR addr, int len) int mips_insert_watchpoint (CORE_ADDR addr, int len, int type) { - if (set_breakpoint (addr, len, type)) + if (mips_set_breakpoint (addr, len, type)) return -1; return 0; @@ -2302,7 +2303,7 @@ mips_insert_watchpoint (CORE_ADDR addr, int len, int type) int mips_remove_watchpoint (CORE_ADDR addr, int len, int type) { - if (clear_breakpoint (addr, len, type)) + if (mips_clear_breakpoint (addr, len, type)) return -1; return 0; @@ -2318,18 +2319,18 @@ mips_stopped_by_watchpoint (void) /* Insert a breakpoint. */ static int -set_breakpoint (CORE_ADDR addr, int len, enum break_type type) +mips_set_breakpoint (CORE_ADDR addr, int len, enum break_type type) { - return common_breakpoint (1, addr, len, type); + return mips_common_breakpoint (1, addr, len, type); } /* Clear a breakpoint. */ static int -clear_breakpoint (CORE_ADDR addr, int len, enum break_type type) +mips_clear_breakpoint (CORE_ADDR addr, int len, enum break_type type) { - return common_breakpoint (0, addr, len, type); + return mips_common_breakpoint (0, addr, len, type); } @@ -2338,10 +2339,10 @@ clear_breakpoint (CORE_ADDR addr, int len, enum break_type type) print the warning text and return 0. If it's an error, print the error text and return 1. <ADDR> is the address of the breakpoint that was being set. <RERRFLG> is the error code returned by PMON. - This is a helper function for common_breakpoint. */ + This is a helper function for mips_common_breakpoint. */ static int -check_lsi_error (CORE_ADDR addr, int rerrflg) +mips_check_lsi_error (CORE_ADDR addr, int rerrflg) { struct lsi_error *err; char *saddr = paddr_nz (addr); /* printable address string */ @@ -2360,15 +2361,15 @@ check_lsi_error (CORE_ADDR addr, int rerrflg) if ((err->code & rerrflg) == err->code) { found = 1; - fprintf_unfiltered (gdb_stderr, - "common_breakpoint (0x%s): Warning: %s\n", + fprintf_unfiltered (gdb_stderr, "\ +mips_common_breakpoint (0x%s): Warning: %s\n", saddr, err->string); } } if (!found) - fprintf_unfiltered (gdb_stderr, - "common_breakpoint (0x%s): Unknown warning: 0x%x\n", + fprintf_unfiltered (gdb_stderr, "\ +mips_common_breakpoint (0x%s): Unknown warning: 0x%x\n", saddr, rerrflg); } @@ -2380,15 +2381,15 @@ check_lsi_error (CORE_ADDR addr, int rerrflg) { if ((err->code & rerrflg) == err->code) { - fprintf_unfiltered (gdb_stderr, - "common_breakpoint (0x%s): Error: %s\n", + fprintf_unfiltered (gdb_stderr, "\ +mips_common_breakpoint (0x%s): Error: %s\n", saddr, err->string); return 1; } } - fprintf_unfiltered (gdb_stderr, - "common_breakpoint (0x%s): Unknown error: 0x%x\n", + fprintf_unfiltered (gdb_stderr, "\ +mips_common_breakpoint (0x%s): Unknown error: 0x%x\n", saddr, rerrflg); return 1; @@ -2409,7 +2410,7 @@ check_lsi_error (CORE_ADDR addr, int rerrflg) Return 0 if successful; otherwise 1. */ static int -common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type) +mips_common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type) { char buf[DATA_MAXLEN + 1]; char cmd, rcmd; @@ -2442,7 +2443,8 @@ common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type) /* Clear the table entry and tell PMON to clear the breakpoint. */ if (i == MAX_LSI_BREAKPOINTS) { - warning ("common_breakpoint: Attempt to clear bogus breakpoint at %s\n", + warning ("\ +mips_common_breakpoint: Attempt to clear bogus breakpoint at %s\n", paddr_nz (addr)); return 1; } @@ -2456,9 +2458,11 @@ common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type) nfields = sscanf (buf, "0x%x b 0x0 0x%x", &rpid, &rerrflg); if (nfields != 2) - mips_error ("common_breakpoint: Bad response from remote board: %s", buf); + mips_error ("\ +mips_common_breakpoint: Bad response from remote board: %s", + buf); - return (check_lsi_error (addr, rerrflg)); + return (mips_check_lsi_error (addr, rerrflg)); } else /* set a breakpoint */ @@ -2508,10 +2512,12 @@ common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type) nfields = sscanf (buf, "0x%x %c 0x%x 0x%x", &rpid, &rcmd, &rresponse, &rerrflg); if (nfields != 4 || rcmd != cmd || rresponse > 255) - mips_error ("common_breakpoint: Bad response from remote board: %s", buf); + mips_error ("\ +mips_common_breakpoint: Bad response from remote board: %s", + buf); if (rerrflg != 0) - if (check_lsi_error (addr, rerrflg)) + if (mips_check_lsi_error (addr, rerrflg)) return 1; /* rresponse contains PMON's breakpoint number. Record the @@ -2575,7 +2581,8 @@ common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type) &rpid, &rcmd, &rerrflg, &rresponse); if (nfields != 4 || rcmd != cmd) - mips_error ("common_breakpoint: Bad response from remote board: %s", + mips_error ("\ +mips_common_breakpoint: Bad response from remote board: %s", buf); if (rerrflg != 0) @@ -2585,8 +2592,8 @@ common_breakpoint (int set, CORE_ADDR addr, int len, enum break_type type) if (mips_monitor == MON_DDB) rresponse = rerrflg; if (rresponse != 22) /* invalid argument */ - fprintf_unfiltered (gdb_stderr, - "common_breakpoint (0x%s): Got error: 0x%x\n", + fprintf_unfiltered (gdb_stderr, "\ +mips_common_breakpoint (0x%s): Got error: 0x%x\n", paddr_nz (addr), rresponse); return 1; } |