lldb strange error
Asked Answered
P

4

21

I am using xCode 4.3.1 and as soon I want to use lldb, I hardly get any debug information but get the following result instead, po-ing on a simple NSMutableDictionary property:

(lldb) po _keywordCache
error: instance method 'delegate' has incompatible result types in different translation units ('objc_object *' vs. 'id')
error: instance method 'delegate' has incompatible result types in different translation units ('objc_object *' vs. 'id')
note: instance method 'delegate' also declared here
note: declared here with type 'id'
note: instance method 'delegate' also declared here
note: declared here with type 'id'
error: 2 errors parsing expression

Switching to gdb always gives proper results.
Anyone an idea?

Pyretotherapy answered 16/4, 2012 at 8:45 Comment(2)
No suggestions yet, but I just want to add that I have the same issue.Enchantress
I am currently seeing this with Xcode 5.1.1 when I type expr tableView.translatesAutoresizingMaskIntoConstraints in the debugger: it says error: instance method 'undoManager' has incompatible result types ...Crossbred
E
8

The source of the problem in my case was that the property in question here, "delegate" is declared as a subtly different type in the instance variable and the property declaration. In my case, the instance variable type was id and the property declaration was id<SomeProtocol>.

I'm going to report this as a bug to Apple, as it shouldn't cause failure to inspect variables. The fix is to make sure that the instance variable and the property declaration describe "delegate" as exactly the same type. Hope this helps!

Enchantress answered 19/4, 2012 at 15:12 Comment(3)
Do you have a open radar I can dupe? This has been bugging me as well.Stelu
Hi Ben - I ended up not reporting this because in my tests with the latest tools on Mountain Lion, it appears to be fixed.Enchantress
I am seeing this right now with the latest mountain lion and Xcode. It's in RestKit when (e.g.) a property is ailased to an id iVar but the property is an NSObject*Chunchung
S
1

I know this is late, but ran into this on Xcode 6, needed to do a Clean Build Folder (hold down option while selecting clean).

Spoke answered 23/9, 2014 at 18:14 Comment(0)
A
1

I have the same problem in Xcode 7.3 (7D1002) since yesterday. Before it worked fine for weeks. In my case now even a simple "po someString" doesn't work:
    error: instance method 'URLEncodedString' has incompatible result types in different translation units ('void *' vs. 'NSString *')
    error: instance method 'URLDecodedString' has incompatible result types in different translation units ('void *' vs. 'NSString *')
    note: instance method 'URLEncodedString' also declared here
    note: instance method 'URLDecodedString' also declared here
    error: 2 errors parsing expression

Things I tried:

  • quit and relaunch Xcode7 and the simulator (they were both running since several days without relaunch)
  • Xcode:Product->Clean and (holding the option key) Clean build folder
  • Delete ~/Library/Preferences/com.apple.dt.Xcode.plist
  • Delete ~/Library/Developer/Xcode/DerivedData/*
  • Delete ~/Library/Developer/Xcode/iOS DeviceSupport/*
  • Install the latest OS X El Capitan Update 10.11.4

but all that didn’t help. Still can neither p nor po strings in the debugger.

I still have an old Xcode 6 on my Mac (renamed and put away before installation of Xcode 7, then put back in /Applications). And that still works, I can enter “po someString” in the debugger and it prints the string into the debug log. But Xcode 7 doesn´t…

I found a workaround for local variables (even though this problem is different) here:
http://lists.apple.com/archives/xcode-users/2014/May/msg00088.html
ctrl-click on variable in local variables list and choose “print description”
    Printing description of someString:
    ipad

which helps a little but cannot print more complex commands.

Artistic answered 3/5, 2016 at 12:26 Comment(0)
G
-1

I also had that error, for me it actually had nothing wrong with the code though. All i did was click the button on the right of the "Toggle global breakpoint state" button in the console.

It is the blue arrow shaped button.
It is the blue, arrow-shaped button.

Guppy answered 2/5, 2014 at 20:51 Comment(2)
Where is that button? Can you provide a screenshot ?Vedic
That is a button to allow breakpoints. It is completely separated from the problem.Whaling

© 2022 - 2024 — McMap. All rights reserved.