* server.c (process_serial_event): Add support for Z0 and Z1 packet.
* target.h (target_ops): Comment for *_watchpoint to make it clear the functions can get types '0' and '1'.
This commit is contained in:
parent
0639a6f662
commit
c631402292
3 changed files with 50 additions and 53 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2009-06-23 Aleksandar Ristovski <aristovski@qnx.com>
|
||||||
|
|
||||||
|
* server.c (process_serial_event): Add support for Z0 and Z1 packet.
|
||||||
|
* target.h (target_ops): Comment for *_watchpoint to make it clear
|
||||||
|
the functions can get types '0' and '1'.
|
||||||
|
|
||||||
2009-06-22 Aleksandar Ristovski <aristovski@qnx.com>
|
2009-06-22 Aleksandar Ristovski <aristovski@qnx.com>
|
||||||
|
|
||||||
* linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
|
* linux-low.c (usr_fetch_inferior_registers): Remove check for regno 0.
|
||||||
|
|
|
@ -2371,66 +2371,56 @@ process_serial_event (void)
|
||||||
signal = 0;
|
signal = 0;
|
||||||
myresume (own_buf, 1, signal);
|
myresume (own_buf, 1, signal);
|
||||||
break;
|
break;
|
||||||
case 'Z':
|
case 'Z': /* insert_ ... */
|
||||||
|
/* Fallthrough. */
|
||||||
|
case 'z': /* remove_ ... */
|
||||||
{
|
{
|
||||||
char *lenptr;
|
char *lenptr;
|
||||||
char *dataptr;
|
char *dataptr;
|
||||||
CORE_ADDR addr = strtoul (&own_buf[3], &lenptr, 16);
|
CORE_ADDR addr = strtoul (&own_buf[3], &lenptr, 16);
|
||||||
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;
|
||||||
|
const int insert_ = ch == 'Z';
|
||||||
|
|
||||||
|
/* Type: '0' - software-breakpoint
|
||||||
|
'1' - hardware-breakpoint
|
||||||
|
'2' - write watchpoint
|
||||||
|
'3' - read watchpoint
|
||||||
|
'4' - access watchpoint */
|
||||||
|
|
||||||
if (the_target->insert_watchpoint == NULL
|
if (the_target->insert_watchpoint == NULL
|
||||||
|| (type < '2' || type > '4'))
|
|| the_target->remove_watchpoint == NULL)
|
||||||
{
|
res = 1; /* Not supported. */
|
||||||
/* No watchpoint support or not a watchpoint command;
|
|
||||||
unrecognized either way. */
|
|
||||||
own_buf[0] = '\0';
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
switch (type)
|
||||||
int res;
|
{
|
||||||
|
case '2':
|
||||||
|
/* Fallthrough. */
|
||||||
|
case '3':
|
||||||
|
/* Fallthrough. */
|
||||||
|
case '4':
|
||||||
|
require_running (own_buf);
|
||||||
|
/* Fallthrough. */
|
||||||
|
case '0':
|
||||||
|
/* Fallthrough. */
|
||||||
|
case '1':
|
||||||
|
res = insert_ ? (*the_target->insert_watchpoint) (type, addr,
|
||||||
|
len)
|
||||||
|
: (*the_target->remove_watchpoint) (type, addr,
|
||||||
|
len);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
res = -1; /* Unrecognized type. */
|
||||||
|
}
|
||||||
|
|
||||||
require_running (own_buf);
|
if (res == 0)
|
||||||
res = (*the_target->insert_watchpoint) (type, addr, len);
|
write_ok (own_buf);
|
||||||
if (res == 0)
|
else if (res == 1)
|
||||||
write_ok (own_buf);
|
/* Unsupported. */
|
||||||
else if (res == 1)
|
own_buf[0] = '\0';
|
||||||
/* Unsupported. */
|
|
||||||
own_buf[0] = '\0';
|
|
||||||
else
|
|
||||||
write_enn (own_buf);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 'z':
|
|
||||||
{
|
|
||||||
char *lenptr;
|
|
||||||
char *dataptr;
|
|
||||||
CORE_ADDR addr = strtoul (&own_buf[3], &lenptr, 16);
|
|
||||||
int len = strtol (lenptr + 1, &dataptr, 16);
|
|
||||||
char type = own_buf[1];
|
|
||||||
|
|
||||||
if (the_target->remove_watchpoint == NULL
|
|
||||||
|| (type < '2' || type > '4'))
|
|
||||||
{
|
|
||||||
/* No watchpoint support or not a watchpoint command;
|
|
||||||
unrecognized either way. */
|
|
||||||
own_buf[0] = '\0';
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
write_enn (own_buf);
|
||||||
int res;
|
|
||||||
|
|
||||||
require_running (own_buf);
|
|
||||||
res = (*the_target->remove_watchpoint) (type, addr, len);
|
|
||||||
if (res == 0)
|
|
||||||
write_ok (own_buf);
|
|
||||||
else if (res == 1)
|
|
||||||
/* Unsupported. */
|
|
||||||
own_buf[0] = '\0';
|
|
||||||
else
|
|
||||||
write_enn (own_buf);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 'k':
|
case 'k':
|
||||||
|
|
|
@ -216,10 +216,11 @@ struct target_ops
|
||||||
/* Insert and remove a hardware watchpoint.
|
/* Insert and remove a hardware 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:
|
||||||
2 = write watchpoint
|
'0' - software-breakpoint
|
||||||
3 = read watchpoint
|
'1' - hardware-breakpoint
|
||||||
4 = access watchpoint
|
'2' - write watchpoint
|
||||||
*/
|
'3' - read watchpoint
|
||||||
|
'4' - access watchpoint */
|
||||||
|
|
||||||
int (*insert_watchpoint) (char type, CORE_ADDR addr, int len);
|
int (*insert_watchpoint) (char type, CORE_ADDR addr, int len);
|
||||||
int (*remove_watchpoint) (char type, CORE_ADDR addr, int len);
|
int (*remove_watchpoint) (char type, CORE_ADDR addr, int len);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue