Assuming you're running linux, there are some ebpf programs that can accomplish this already, no breakpoints needed.
Do you have any that you would recommend specifically?
This blog post talks about some of the existing tools and their tradeoffs: http://mysqlentomologist.blogspot.com/2021/05/dynamic-tracin...