If you want to attach a debugger to osquery, look ...
# general
m
If you want to attach a debugger to osquery, look for the
osqueryd
process. But it forks itself to create a worker process and a watchdog process, so you can either run it with the flag that turns off the watchdog or you can use a debugger that can follow and debug the forked processes, in order to hit the breakpoint you want.