2005-05-12 Orjan Friberg <orjanf@axis.com>
* target.h (struct target_ops): Add insert_watchpoint, remove_watchpoint, stopped_by_watchpoint, stopped_data_address function pointers for hardware watchpoint support. * linux-low.h (struct linux_target_ops): Ditto. * linux-low.c (linux_insert_watchpoint, linux_remove_watchpoint) (linux_stopped_by_watchpoint, linux_stopped_data_address): New. Add to linux_target_ops. * remote-utils.c (prepare_resume_reply): Add watchpoint information to reply packet. * server.c (main): Recognize 'Z' and 'z' packets.
This commit is contained in:
parent
119b882a3d
commit
e013ee27c9
6 changed files with 168 additions and 1 deletions
|
@ -639,6 +639,28 @@ prepare_resume_reply (char *buf, char status, unsigned char signo)
|
|||
if (status == 'T')
|
||||
{
|
||||
const char **regp = gdbserver_expedite_regs;
|
||||
|
||||
if (the_target->stopped_by_watchpoint != NULL
|
||||
&& (*the_target->stopped_by_watchpoint) ())
|
||||
{
|
||||
CORE_ADDR addr;
|
||||
int i;
|
||||
|
||||
strncpy (buf, "watch:", 6);
|
||||
buf += 6;
|
||||
|
||||
addr = (*the_target->stopped_data_address) ();
|
||||
|
||||
/* Convert each byte of the address into two hexadecimal chars.
|
||||
Note that we take sizeof (void *) instead of sizeof (addr);
|
||||
this is to avoid sending a 64-bit address to a 32-bit GDB. */
|
||||
for (i = sizeof (void *) * 2; i > 0; i--)
|
||||
{
|
||||
*buf++ = tohex ((addr >> (i - 1) * 4) & 0xf);
|
||||
}
|
||||
*buf++ = ';';
|
||||
}
|
||||
|
||||
while (*regp)
|
||||
{
|
||||
buf = outreg (find_regno (*regp), buf);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue