GDB has an option to set watchpoint on register*, how does it work ? what happens during context switching ? why the only implementation is for mips ?
Is there a way to make it work for
lldb also ?
watch $eax == 0x0000ffff
You can probably find the details in GDB’s source code but I think it just single-steps the program until the condition matches. IIRC this is done for any condition that can’t be handled by a hardware breakpoint.