forked from Imagelibrary/binutils-gdb
* 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.
This commit is contained in:
@@ -1,3 +1,14 @@
|
|||||||
|
2008-02-06 Maciej W. Rozycki <macro@mips.com>
|
||||||
|
|
||||||
|
* 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.
|
||||||
|
|
||||||
2007-02-05 Joel Brobecker <brobecker@adacore.com>
|
2007-02-05 Joel Brobecker <brobecker@adacore.com>
|
||||||
|
|
||||||
* language.h (struct language_defn): Add new field
|
* language.h (struct language_defn): Add new field
|
||||||
|
|||||||
@@ -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,
|
static int mips_make_srec (char *buffer, int type, CORE_ADDR memaddr,
|
||||||
unsigned char *myaddr, int len);
|
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,
|
static int mips_common_breakpoint (int set, CORE_ADDR addr, int len,
|
||||||
enum break_type type);
|
enum break_type type);
|
||||||
|
|
||||||
/* Forward declarations. */
|
/* Forward declarations. */
|
||||||
extern struct target_ops mips_ops;
|
extern struct target_ops mips_ops;
|
||||||
@@ -1450,7 +1451,7 @@ mips_initialize (void)
|
|||||||
|
|
||||||
/* Clear all breakpoints: */
|
/* Clear all breakpoints: */
|
||||||
if ((mips_monitor == MON_IDT
|
if ((mips_monitor == MON_IDT
|
||||||
&& clear_breakpoint (-1, 0, BREAK_UNUSED) == 0)
|
&& mips_clear_breakpoint (-1, 0, BREAK_UNUSED) == 0)
|
||||||
|| mips_monitor == MON_LSI)
|
|| mips_monitor == MON_LSI)
|
||||||
monitor_supports_breakpoints = 1;
|
monitor_supports_breakpoints = 1;
|
||||||
else
|
else
|
||||||
@@ -2236,8 +2237,8 @@ static int
|
|||||||
mips_insert_breakpoint (struct bp_target_info *bp_tgt)
|
mips_insert_breakpoint (struct bp_target_info *bp_tgt)
|
||||||
{
|
{
|
||||||
if (monitor_supports_breakpoints)
|
if (monitor_supports_breakpoints)
|
||||||
return set_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE,
|
return mips_set_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE,
|
||||||
BREAK_FETCH);
|
BREAK_FETCH);
|
||||||
else
|
else
|
||||||
return memory_insert_breakpoint (bp_tgt);
|
return memory_insert_breakpoint (bp_tgt);
|
||||||
}
|
}
|
||||||
@@ -2246,8 +2247,8 @@ static int
|
|||||||
mips_remove_breakpoint (struct bp_target_info *bp_tgt)
|
mips_remove_breakpoint (struct bp_target_info *bp_tgt)
|
||||||
{
|
{
|
||||||
if (monitor_supports_breakpoints)
|
if (monitor_supports_breakpoints)
|
||||||
return clear_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE,
|
return mips_clear_breakpoint (bp_tgt->placed_address, MIPS_INSN32_SIZE,
|
||||||
BREAK_FETCH);
|
BREAK_FETCH);
|
||||||
else
|
else
|
||||||
return memory_remove_breakpoint (bp_tgt);
|
return memory_remove_breakpoint (bp_tgt);
|
||||||
}
|
}
|
||||||
@@ -2293,7 +2294,7 @@ calculate_mask (CORE_ADDR addr, int len)
|
|||||||
int
|
int
|
||||||
mips_insert_watchpoint (CORE_ADDR addr, int len, int type)
|
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 -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -2302,7 +2303,7 @@ mips_insert_watchpoint (CORE_ADDR addr, int len, int type)
|
|||||||
int
|
int
|
||||||
mips_remove_watchpoint (CORE_ADDR addr, int len, int type)
|
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 -1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -2318,18 +2319,18 @@ mips_stopped_by_watchpoint (void)
|
|||||||
/* Insert a breakpoint. */
|
/* Insert a breakpoint. */
|
||||||
|
|
||||||
static int
|
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. */
|
/* Clear a breakpoint. */
|
||||||
|
|
||||||
static int
|
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
|
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
|
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.
|
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
|
static int
|
||||||
check_lsi_error (CORE_ADDR addr, int rerrflg)
|
mips_check_lsi_error (CORE_ADDR addr, int rerrflg)
|
||||||
{
|
{
|
||||||
struct lsi_error *err;
|
struct lsi_error *err;
|
||||||
char *saddr = paddr_nz (addr); /* printable address string */
|
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)
|
if ((err->code & rerrflg) == err->code)
|
||||||
{
|
{
|
||||||
found = 1;
|
found = 1;
|
||||||
fprintf_unfiltered (gdb_stderr,
|
fprintf_unfiltered (gdb_stderr, "\
|
||||||
"common_breakpoint (0x%s): Warning: %s\n",
|
mips_common_breakpoint (0x%s): Warning: %s\n",
|
||||||
saddr,
|
saddr,
|
||||||
err->string);
|
err->string);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found)
|
if (!found)
|
||||||
fprintf_unfiltered (gdb_stderr,
|
fprintf_unfiltered (gdb_stderr, "\
|
||||||
"common_breakpoint (0x%s): Unknown warning: 0x%x\n",
|
mips_common_breakpoint (0x%s): Unknown warning: 0x%x\n",
|
||||||
saddr,
|
saddr,
|
||||||
rerrflg);
|
rerrflg);
|
||||||
}
|
}
|
||||||
@@ -2380,15 +2381,15 @@ check_lsi_error (CORE_ADDR addr, int rerrflg)
|
|||||||
{
|
{
|
||||||
if ((err->code & rerrflg) == err->code)
|
if ((err->code & rerrflg) == err->code)
|
||||||
{
|
{
|
||||||
fprintf_unfiltered (gdb_stderr,
|
fprintf_unfiltered (gdb_stderr, "\
|
||||||
"common_breakpoint (0x%s): Error: %s\n",
|
mips_common_breakpoint (0x%s): Error: %s\n",
|
||||||
saddr,
|
saddr,
|
||||||
err->string);
|
err->string);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fprintf_unfiltered (gdb_stderr,
|
fprintf_unfiltered (gdb_stderr, "\
|
||||||
"common_breakpoint (0x%s): Unknown error: 0x%x\n",
|
mips_common_breakpoint (0x%s): Unknown error: 0x%x\n",
|
||||||
saddr,
|
saddr,
|
||||||
rerrflg);
|
rerrflg);
|
||||||
return 1;
|
return 1;
|
||||||
@@ -2409,7 +2410,7 @@ check_lsi_error (CORE_ADDR addr, int rerrflg)
|
|||||||
Return 0 if successful; otherwise 1. */
|
Return 0 if successful; otherwise 1. */
|
||||||
|
|
||||||
static int
|
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 buf[DATA_MAXLEN + 1];
|
||||||
char cmd, rcmd;
|
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. */
|
/* Clear the table entry and tell PMON to clear the breakpoint. */
|
||||||
if (i == MAX_LSI_BREAKPOINTS)
|
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));
|
paddr_nz (addr));
|
||||||
return 1;
|
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);
|
nfields = sscanf (buf, "0x%x b 0x0 0x%x", &rpid, &rerrflg);
|
||||||
if (nfields != 2)
|
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
|
else
|
||||||
/* set a breakpoint */
|
/* 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",
|
nfields = sscanf (buf, "0x%x %c 0x%x 0x%x",
|
||||||
&rpid, &rcmd, &rresponse, &rerrflg);
|
&rpid, &rcmd, &rresponse, &rerrflg);
|
||||||
if (nfields != 4 || rcmd != cmd || rresponse > 255)
|
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 (rerrflg != 0)
|
||||||
if (check_lsi_error (addr, rerrflg))
|
if (mips_check_lsi_error (addr, rerrflg))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
/* rresponse contains PMON's breakpoint number. Record the
|
/* 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);
|
&rpid, &rcmd, &rerrflg, &rresponse);
|
||||||
|
|
||||||
if (nfields != 4 || rcmd != cmd)
|
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);
|
buf);
|
||||||
|
|
||||||
if (rerrflg != 0)
|
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)
|
if (mips_monitor == MON_DDB)
|
||||||
rresponse = rerrflg;
|
rresponse = rerrflg;
|
||||||
if (rresponse != 22) /* invalid argument */
|
if (rresponse != 22) /* invalid argument */
|
||||||
fprintf_unfiltered (gdb_stderr,
|
fprintf_unfiltered (gdb_stderr, "\
|
||||||
"common_breakpoint (0x%s): Got error: 0x%x\n",
|
mips_common_breakpoint (0x%s): Got error: 0x%x\n",
|
||||||
paddr_nz (addr), rresponse);
|
paddr_nz (addr), rresponse);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user