Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9150363
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:36:06+00:00 2026-06-17T11:36:06+00:00

I am using some GCD code which dispatches a bunch of similar async blocks.

  • 0

I am using some GCD code which dispatches a bunch of similar async blocks. I would like to debug one of these blocks by stepping through it so I’ve set a breakpoint somewhere near the top of the block, but the debugger hits the breakpoint every time a new block is submitted and so I never manage to step through the block, I just get swapped around different threads on the same line.

My question is how do I set a breakpoint so that its conditional upon a certain thread? i.e. it should only trigger if executed on thread 4?

EDIT

I should add that my block’s code is very time intensive, so the scheduler swaps onto another thread before the next line inside the block can be executed, and another freshly scheduled GCD block gets its turn, triggering the same breakpoint.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T11:36:07+00:00Added an answer on June 17, 2026 at 11:36 am

    I don’t think this is exposed through the Xcode Breakpoints UI but in lldb you can modify a breakpoint so it only fires when a (1) thread name matches, (2) dispatch queue name matches, (3) thread ID matches, or (4) thread index number matches. You can specify these criteria when you create the breakpoint (breakpoint set) or you can add these criteria to an existing breakpoint with breakpoint modify. See help breakpoint modify in the Debugger console window for a list of the allowed arguments.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using some off-the-shelf OSGi bundles in my application and would like to repackage
I have some C code in an iOS project that I would like to
I'm using GCD's dispatch_after method when my application is being loaded to perform some
Using some of the methods, I am able to check the orientations to which
I am using some easing functions in C# which give Ease In and Ease
I am using some legacy code to return an Excel worksheet as a Dataset.
I remember using some attribute on the getter/setter that would limit the input to
I have got some experience using GCD for concurrency and removing explicit locks and
I'm using GCD to do some background loading from the internet. This works great
Using some example code I found here on SO , I've put together a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.