I'm debugging an issue in my project involving grand central dispatch. In debugging this, it would be really helpful to have a way of being notified when work is dispatched to a specific queue.
Is there some way of setting a symbolic breakpoint on dispatch_async with a condition that could check whether the dispatch queue argument is the same as some other queue that I have access to?
Here's how to set a conditional breakpoint. (I haven't done conditions on queues, I'm making the assumption here that pointer equality will Just Work™.)
First get the address of the queue you want, let's say it's 0x12345678. Then create a breakpoint:
breakpoint set -n dispatch_async -c '$register == 0x12345678'
Replace $register with an expression specific to the architecture.
Updated to show $arg1 from Jim Ingham's comment
Simulator
*(id*)($esp+4)$arg1 (aka $rdi)Device
$arg1 (aka $r0)$arg1 (aka $x0)If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With