Re: Breakpoint condition "foo == YES" is ignored
Re: Breakpoint condition "foo == YES" is ignored
- Subject: Re: Breakpoint condition "foo == YES" is ignored
- From: Han Ming Ong <email@hidden>
- Date: Mon, 03 Feb 2014 11:15:27 -0800
Here's another tip: whenever you find that a conditional breakpoint is not working as expected, try copying and pasting that expression directly into the Console Area, with an 'expr' prepended. If there is a problem, lldb will print out a message about what's wrong with the expression.
Han Ming
On Feb 3, 2014, at 11:07 AM, email@hidden wrote:
>
> On Feb 2, 2014, at 10:25 PM, Jerry Krinock <email@hidden> wrote:
>
>> 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!!!!
>>
>>
>
> One of the unfortunate necessities in order to render the size of debug information tractable for large systems like Mac OS X is that the compiler only emits debug information for functions at the point where the function is defined, not in every compilation unit that includes its declaration. If it didn't do that every .m file you build would include debug information for every function in the Cocoa.h header tree. That means that the debugger does not in fact have function signatures for most of the functions in the Cocoa header tree.
>
> Note, the debugger refuses to call functions it knows nothing about because calling a function that returns a structure as if it returns some scalar quantity would on most ABI's result in stack corruption and your program mysteriously crashing or getting bad data when you resumed it. So we force you to cast rather than silently introducing bugs into the running of your program.
>
> For functions you call a lot, you can put declarations in the expression prefix file (set with "settings set target.expr-prefix") That's like providing an extra #include to your expressions. Don't go crazy and try to do something like "#include <Foundation/Foundation.h>" both because this will really slow down expression evaluation, and won't actually work since something as complex as Foundation depends on macros (for architecture, OS version and the like) that the debugger doesn't have access to. But you can put in simple declarations of functions you use often, and that will get around having to cast them all the time.
>
> Hope this helps.
>
> Jim
> _______________________________________________
> 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
_______________________________________________
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