• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Breakpoint condition "foo == YES" is ignored
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Breakpoint condition "foo == YES" is ignored


  • Subject: Re: Breakpoint condition "foo == YES" is ignored
  • From: Fritz Anderson <email@hidden>
  • Date: Sun, 02 Feb 2014 23:45:37 -0600

On Feb 2, 2014, at 10:45 PM, Jerry Krinock <email@hidden> wrote:

> In the “Condition” field, enter:  foo == YES

Your question deserves more and better attention than I can give at bedtime, and this doesn’t seem to relate directly to your problem (the surprising value is 0), but this has to go into the record as often as humanly possible:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Do not compare against YES. Ever.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

It seems a true Boolean type is being phased into Objective-C, but for the past quarter-century, BOOL has been defined as signed char, and YES as ((BOOL)1). YES is true in C conditionals.

So is 42. If foo==42, your code will behave as if foo==YES, but your breakpoint will never fire.


As to

> foo should be YES, because that was a breakpoint condition.

Do you have any reason to believe that, other than that if the debugger does it, it must be so?

What is the optimization level?

I’ve found lldb surprisingly picky about conditional expressions. I find I have to cast aggressively, particularly at the outer expression: (BOOL) (onlyIfVulnerable != NO). Try that.

When I don’t cast religiously, lldb refuses to see anything it can use as a condition in the breakpoint-condition field. Execution gets to the breakpoint, lldb can’t handle the condition, so it breaks _unconditionally,_ and prints a message saying it can’t parse the condition.

Your video cut off the bottom of the console view before you erased it. What was at the bottom?

	— F


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: Breakpoint condition "foo == YES" is ignored
      • From: Jerry Krinock <email@hidden>
References: 
 >Breakpoint condition "foo == YES" is ignored (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Breakpoint condition "foo == YES" is ignored
  • Next by Date: Re: Breakpoint condition "foo == YES" is ignored
  • Previous by thread: Re: Breakpoint condition "foo == YES" is ignored
  • Next by thread: Re: Breakpoint condition "foo == YES" is ignored
  • Index(es):
    • Date
    • Thread