Files
clang-p2996/lldb/test/API/functionalities/watchpoint/consecutive-watchpoints/main.c
Jason Molenda df28c81f5a [lldb][debugserver] Fix an off-by-one error in watchpoint identification (#134314)
debugserver takes the address of a watchpoint exception and calculates
which watchpoint was responsible for it. There was an off-by-one error
in the range calculation which causes two watchpoints on consecutive
ranges to not correctly identify hits to the second watchpoint. The
result is that lldb wouldn't show the second watchpoint as ever being
hit.

Re-landing this test with a modification to only require two
watchpoints in the test, instead of four.  If four watchpoints can
be set, it will test them.

rdar://145107575
2025-04-07 13:50:31 -07:00

23 lines
451 B
C

#include <stdint.h>
struct fields {
uint32_t field1;
uint32_t field2; // offset +4
uint16_t field3; // offset +8
uint16_t field4; // offset +10
uint16_t field5; // offset +12
uint16_t field6; // offset +14
};
int main() {
struct fields var = {0, 0, 0, 0, 0, 0};
var.field1 = 5; // break here
var.field2 = 6;
var.field3 = 7;
var.field4 = 8;
var.field5 = 9;
var.field6 = 10;
return var.field1 + var.field2 + var.field3;
}