* server.c (process_serial_event): Re-return unsupported, not
error, if the type isn't recognized. Re-allow supporting only insert or remove packets. Also call require_running for breakpoints. Add missing break statement to default case. Tidy. * target.h (struct target_ops): Rename insert_watchpoint to insert_point, and remove_watchpoint to remove_point. * linux-low.h (struct linux_target_ops): Likewise. * linux-low.c (linux_insert_watchpoint): Rename to ... (linux_insert_point): ... this. Adjust. (linux_remove_watchpoint): Rename to ... (linux_remove_point): ... this. Adjust. (linux_target_ops): Adjust. * linux-crisv32-low.c (cris_insert_watchpoint): Rename to ... (cris_insert_point): ... this. (cris_remove_watchpoint): Rename to ... (cris_remove_point): ... this. (the_low_target): Adjust.
This commit is contained in:
parent
f3a5f1de54
commit
d993e290c9
|
@ -1,3 +1,24 @@
|
||||||
|
2009-06-25 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
|
* server.c (process_serial_event): Re-return unsupported, not
|
||||||
|
error, if the type isn't recognized. Re-allow supporting only
|
||||||
|
insert or remove packets. Also call require_running for
|
||||||
|
breakpoints. Add missing break statement to default case. Tidy.
|
||||||
|
* target.h (struct target_ops): Rename insert_watchpoint to
|
||||||
|
insert_point, and remove_watchpoint to remove_point.
|
||||||
|
|
||||||
|
* linux-low.h (struct linux_target_ops): Likewise.
|
||||||
|
* linux-low.c (linux_insert_watchpoint): Rename to ...
|
||||||
|
(linux_insert_point): ... this. Adjust.
|
||||||
|
(linux_remove_watchpoint): Rename to ...
|
||||||
|
(linux_remove_point): ... this. Adjust.
|
||||||
|
(linux_target_ops): Adjust.
|
||||||
|
* linux-crisv32-low.c (cris_insert_watchpoint): Rename to ...
|
||||||
|
(cris_insert_point): ... this.
|
||||||
|
(cris_remove_watchpoint): Rename to ...
|
||||||
|
(cris_remove_point): ... this.
|
||||||
|
(the_low_target): Adjust.
|
||||||
|
|
||||||
2009-06-24 Pierre Muller <muller@ics.u-strasbg.fr>
|
2009-06-24 Pierre Muller <muller@ics.u-strasbg.fr>
|
||||||
|
|
||||||
* server.c (handle_v_kill): Pass signal_pid to
|
* server.c (handle_v_kill): Pass signal_pid to
|
||||||
|
|
|
@ -137,7 +137,7 @@ cris_write_data_breakpoint (int bp, unsigned long start, unsigned long end)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cris_insert_watchpoint (char type, CORE_ADDR addr, int len)
|
cris_insert_point (char type, CORE_ADDR addr, int len)
|
||||||
{
|
{
|
||||||
int bp;
|
int bp;
|
||||||
unsigned long bp_ctrl;
|
unsigned long bp_ctrl;
|
||||||
|
@ -220,7 +220,7 @@ cris_insert_watchpoint (char type, CORE_ADDR addr, int len)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
cris_remove_watchpoint (char type, CORE_ADDR addr, int len)
|
cris_remove_point (char type, CORE_ADDR addr, int len)
|
||||||
{
|
{
|
||||||
int bp;
|
int bp;
|
||||||
unsigned long bp_ctrl;
|
unsigned long bp_ctrl;
|
||||||
|
@ -375,8 +375,8 @@ struct linux_target_ops the_low_target = {
|
||||||
cris_reinsert_addr,
|
cris_reinsert_addr,
|
||||||
0,
|
0,
|
||||||
cris_breakpoint_at,
|
cris_breakpoint_at,
|
||||||
cris_insert_watchpoint,
|
cris_insert_point,
|
||||||
cris_remove_watchpoint,
|
cris_remove_point,
|
||||||
cris_stopped_by_watchpoint,
|
cris_stopped_by_watchpoint,
|
||||||
cris_stopped_data_address,
|
cris_stopped_data_address,
|
||||||
};
|
};
|
||||||
|
|
|
@ -2671,24 +2671,25 @@ linux_read_auxv (CORE_ADDR offset, unsigned char *myaddr, unsigned int len)
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* These watchpoint related wrapper functions simply pass on the function call
|
/* These breakpoint and watchpoint related wrapper functions simply
|
||||||
if the target has registered a corresponding function. */
|
pass on the function call if the target has registered a
|
||||||
|
corresponding function. */
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linux_insert_watchpoint (char type, CORE_ADDR addr, int len)
|
linux_insert_point (char type, CORE_ADDR addr, int len)
|
||||||
{
|
{
|
||||||
if (the_low_target.insert_watchpoint != NULL)
|
if (the_low_target.insert_point != NULL)
|
||||||
return the_low_target.insert_watchpoint (type, addr, len);
|
return the_low_target.insert_point (type, addr, len);
|
||||||
else
|
else
|
||||||
/* Unsupported (see target.h). */
|
/* Unsupported (see target.h). */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
linux_remove_watchpoint (char type, CORE_ADDR addr, int len)
|
linux_remove_point (char type, CORE_ADDR addr, int len)
|
||||||
{
|
{
|
||||||
if (the_low_target.remove_watchpoint != NULL)
|
if (the_low_target.remove_point != NULL)
|
||||||
return the_low_target.remove_watchpoint (type, addr, len);
|
return the_low_target.remove_point (type, addr, len);
|
||||||
else
|
else
|
||||||
/* Unsupported (see target.h). */
|
/* Unsupported (see target.h). */
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -3030,8 +3031,8 @@ static struct target_ops linux_target_ops = {
|
||||||
linux_look_up_symbols,
|
linux_look_up_symbols,
|
||||||
linux_request_interrupt,
|
linux_request_interrupt,
|
||||||
linux_read_auxv,
|
linux_read_auxv,
|
||||||
linux_insert_watchpoint,
|
linux_insert_point,
|
||||||
linux_remove_watchpoint,
|
linux_remove_point,
|
||||||
linux_stopped_by_watchpoint,
|
linux_stopped_by_watchpoint,
|
||||||
linux_stopped_data_address,
|
linux_stopped_data_address,
|
||||||
#if defined(__UCLIBC__) && defined(HAS_NOMMU)
|
#if defined(__UCLIBC__) && defined(HAS_NOMMU)
|
||||||
|
|
|
@ -80,9 +80,10 @@ struct linux_target_ops
|
||||||
int decr_pc_after_break;
|
int decr_pc_after_break;
|
||||||
int (*breakpoint_at) (CORE_ADDR pc);
|
int (*breakpoint_at) (CORE_ADDR pc);
|
||||||
|
|
||||||
/* Watchpoint related functions. See target.h for comments. */
|
/* Breakpoint and watchpoint related functions. See target.h for
|
||||||
int (*insert_watchpoint) (char type, CORE_ADDR addr, int len);
|
comments. */
|
||||||
int (*remove_watchpoint) (char type, CORE_ADDR addr, int len);
|
int (*insert_point) (char type, CORE_ADDR addr, int len);
|
||||||
|
int (*remove_point) (char type, CORE_ADDR addr, int len);
|
||||||
int (*stopped_by_watchpoint) (void);
|
int (*stopped_by_watchpoint) (void);
|
||||||
CORE_ADDR (*stopped_data_address) (void);
|
CORE_ADDR (*stopped_data_address) (void);
|
||||||
|
|
||||||
|
|
|
@ -2383,37 +2383,25 @@ process_serial_event (void)
|
||||||
int len = strtol (lenptr + 1, &dataptr, 16);
|
int len = strtol (lenptr + 1, &dataptr, 16);
|
||||||
char type = own_buf[1];
|
char type = own_buf[1];
|
||||||
int res;
|
int res;
|
||||||
const int insert_ = ch == 'Z';
|
const int insert = ch == 'Z';
|
||||||
|
|
||||||
/* Type: '0' - software-breakpoint
|
/* Default to unrecognized/unsupported. */
|
||||||
'1' - hardware-breakpoint
|
res = 1;
|
||||||
'2' - write watchpoint
|
|
||||||
'3' - read watchpoint
|
|
||||||
'4' - access watchpoint */
|
|
||||||
|
|
||||||
if (the_target->insert_watchpoint == NULL
|
|
||||||
|| the_target->remove_watchpoint == NULL)
|
|
||||||
res = 1; /* Not supported. */
|
|
||||||
else
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case '2':
|
case '0': /* software-breakpoint */
|
||||||
/* Fallthrough. */
|
case '1': /* hardware-breakpoint */
|
||||||
case '3':
|
case '2': /* write watchpoint */
|
||||||
/* Fallthrough. */
|
case '3': /* read watchpoint */
|
||||||
case '4':
|
case '4': /* access watchpoint */
|
||||||
require_running (own_buf);
|
require_running (own_buf);
|
||||||
/* Fallthrough. */
|
if (insert && the_target->insert_point != NULL)
|
||||||
case '0':
|
res = (*the_target->insert_point) (type, addr, len);
|
||||||
/* Fallthrough. */
|
else if (!insert && the_target->remove_point != NULL)
|
||||||
case '1':
|
res = (*the_target->remove_point) (type, addr, len);
|
||||||
res = insert_ ? (*the_target->insert_watchpoint) (type, addr,
|
|
||||||
len)
|
|
||||||
: (*the_target->remove_watchpoint) (type, addr,
|
|
||||||
len);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
res = -1; /* Unrecognized type. */
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (res == 0)
|
if (res == 0)
|
||||||
|
|
|
@ -213,7 +213,7 @@ struct target_ops
|
||||||
int (*read_auxv) (CORE_ADDR offset, unsigned char *myaddr,
|
int (*read_auxv) (CORE_ADDR offset, unsigned char *myaddr,
|
||||||
unsigned int len);
|
unsigned int len);
|
||||||
|
|
||||||
/* Insert and remove a hardware watchpoint.
|
/* Insert and remove a break or watchpoint.
|
||||||
Returns 0 on success, -1 on failure and 1 on unsupported.
|
Returns 0 on success, -1 on failure and 1 on unsupported.
|
||||||
The type is coded as follows:
|
The type is coded as follows:
|
||||||
'0' - software-breakpoint
|
'0' - software-breakpoint
|
||||||
|
@ -222,8 +222,8 @@ struct target_ops
|
||||||
'3' - read watchpoint
|
'3' - read watchpoint
|
||||||
'4' - access watchpoint */
|
'4' - access watchpoint */
|
||||||
|
|
||||||
int (*insert_watchpoint) (char type, CORE_ADDR addr, int len);
|
int (*insert_point) (char type, CORE_ADDR addr, int len);
|
||||||
int (*remove_watchpoint) (char type, CORE_ADDR addr, int len);
|
int (*remove_point) (char type, CORE_ADDR addr, int len);
|
||||||
|
|
||||||
/* Returns 1 if target was stopped due to a watchpoint hit, 0 otherwise. */
|
/* Returns 1 if target was stopped due to a watchpoint hit, 0 otherwise. */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue