Jerry Ling wrote: > 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 > }; > If that enumeration is defined by GDB protocol, it should not be placed in target.h - doing so is a layering violation which leads to errors just like this one.
cu Michael _______________________________________________ Openocd-development mailing list Openocd-development@lists.berlios.de https://lists.berlios.de/mailman/listinfo/openocd-development