Re: Breakpoint condition "foo == YES" is ignored
Re: Breakpoint condition "foo == YES" is ignored
- Subject: Re: Breakpoint condition "foo == YES" is ignored
- From: Jerry Krinock <email@hidden>
- Date: Sun, 02 Feb 2014 22:25:13 -0800
Thank you for the late-night reply, Fritz.
NEWS: In the last hour I had deleted that breakpoint. So I made a new one. And now the condition works. So it’s a good thing I published the YouTube video showing that, an hour ago, it did not work.
On 2014 Feb 02, at 21:45, Fritz Anderson <email@hidden> wrote:
> Do not compare against YES. Ever.
Makes sense and I’ll try to remember that. I usually don’t do that in code, but when dealing with lldb, I think that, from experience, I reflexively try to hit it over the head.
Retesting now, it makes no difference whether the condition is ‘foo’ or ‘foo == YES’. It WORKS, either way.
>> 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?
No. In fact, foo was NO, but it should have been YES, given the breakpoint condition.
> What is the optimization level?
None -[O0]. (Debug Build)
> 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.
Again, too late to test that because it works now.
> 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.
Yes, I’ve seen that also. One of my favorite lldb irritations is when it tells me it needs a typecast on, for example, the value returned by NSStringFromRect(). Arghhhhh!!!!
> Your video cut off the bottom of the console view before you erased it. What was at the bottom?
There was output from a bunch of unrelated NSLog() statements which had executed earlier. There were no exceptions or anything like that
* * *
On 2014 Feb 02, at 20:59, Roland King <email@hidden> wrote:
> I put it down as a "thing which just doesn't really work" and moved on.
Probably good advice, Roland. Indeed, it would have taken less than a minute to put the condition in the code and rebuild.
_______________________________________________
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