delve icon indicating copy to clipboard operation
delve copied to clipboard

RR chaos mode

Open firelizzard18 opened this issue 6 months ago • 6 comments

Please provide a way to pass the --chaos flag to the rr backend. Either by a dedicated flag such as --rr-chaos or as a general --rr-flags, --backend-flags, --backend-opts, etc.

$ rr record -h
 rr record [OPTION]... <exe> [exe-args]...
  [...]
  -h, --chaos                randomize scheduling decisions to try to 
                             reproduce bugs

Chaos mode is an extremely useful tool for reproducing weird bugs.

firelizzard18 avatar Feb 22 '24 05:02 firelizzard18

It looks like this https://github.com/go-delve/delve/blob/master/pkg/proc/gdbserial/rr.go#L144 line is where the arguments for rr record are constructed.

firelizzard18 avatar Feb 22 '24 05:02 firelizzard18

It looks like this https://github.com/go-delve/delve/blob/master/pkg/proc/gdbserial/rr.go#L144 line is where the arguments for rr record are constructed.

That's replay, record is above in RecordAsync.

aarzilli avatar Feb 22 '24 10:02 aarzilli

🤦 of course

firelizzard18 avatar Feb 23 '24 02:02 firelizzard18

@aarzilli Would you accept a PR for this? Do you have a preferred flag name or other mechanism for setting the RR flag?

firelizzard18 avatar Feb 25 '24 03:02 firelizzard18

Do you have a preferred flag name or other mechanism for setting the RR flag?

That's the problem. The simple way to do this is to add a flag to debug, test and exec but that sucks, they already have too many flags and adding another one that only works when --backend is rr is ugly. The implementation is trivial.

aarzilli avatar Feb 25 '24 06:02 aarzilli

I would prefer to have backend specific --backend-opts parameter to avoid confusion and, probably futher using for other backend.

For example, I can't use rr without --bind-to-cpu=0 option on my CPU and OS combination. Thanks in advance.

dmvolod avatar Mar 05 '24 05:03 dmvolod