Hi,

There is a bug when using gdb to set read/write watchpoint.
OOCD will actually set a "write" watchpoint if you set "read" watchpoint 
through gdb, and vis versa.

Since...
[target/breakpoints.h]
enum watchpoint_rw
{
    WPT_READ = 0, WPT_WRITE = 1, WPT_ACCESS = 2
};

But...
[server/gdb_server.c]
int gdb_breakpoint_watchpoint_packet(...)
{
    ...
    switch (type)
    {
        ...
        case 2:
        case 3:
        case 4:
        {
            ...
                if ((retval = watchpoint_add(target, address, size, type-2, 
0, 0xffffffffu)) != ERROR_OK)
    ...
}

However, gdb defines the order of watchpoint_type as "write", "read" and 
then "access".

I think it's better to modify as below.

[target/breakpoints.h]
enum watchpoint_rw
{
    WPT_WRITE = 0, WPT_READ = 1, WPT_ACCESS = 2
};

[target/breakpoints.c]
static char *watchpoint_rw_strings[] =
{
    "write",
    "read",
    "access"
};

Thanks

Best regards,
- Jerry 


-- 
This message has been scanned for viruses and
dangerous content by Draytek E-mail System, and is
believed to be clean.

_______________________________________________
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development

Reply via email to