• 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: using po in debugger Xcode 5.1.1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: using po in debugger Xcode 5.1.1


  • Subject: Re: using po in debugger Xcode 5.1.1
  • From: Fritz Anderson <email@hidden>
  • Date: Fri, 16 May 2014 11:31:11 -0500

On 15 May 2014, at 12:54 PM, Owen Hartnett <email@hidden> wrote:

Often if I try to use po in ways that had usually worked fine in the past, I get something like:

clang/llvm has been getting stricter with every release; mostly a good idea, but sometimes a headache. I could guess why the context menu works from the variables list but not po * from the lldb command line, but it would be only a guess.

* (Pedantically, “_expression_ -O -- ” [hyphen-oh], but I’m OCD)

po URLcomponentDict
error: instance method 'safeObjectForKey:' has incompatible result types in different translation units ('NSDictionary *' vs. 'id')

Looked like the old have-to-typecast it, so I tried that:

po (NSDictionary *) URLcomponentDict
error: instance method 'safeObjectForKey:' has incompatible result types in different translation units ('NSDictionary *' vs. 'id')
note: instance method 'safeObjectForKey:' also declared here
error: 1 errors parsing _expression_

Workaround:  If I right click in the variables list, and choose Print Description, it does the right thing:

Printing description of URLcomponentDict:
{
    callId = "5770b91e-d326-4d6d-b94b-e6847b5255b6";
    callSubject = "incoming call from inPerson web portal";
    callerImageUrl = "http://insite/In2ItemService_Platform/image/getThumbnailImage/in2Type/LOOMIS_SAYLES_PERSON/idType/USER_NAME/idValue/inPersonWeb.json";
    callerName = "inPerson Web";
    callerUserName = inPersonWeb;
    messageType = "INPERSON.INCOMINGCALL";
}

Printing dictionaries always seemed to work fine with po, but not lately.  Is there something I should be doing differently?

All dictionaries, or only the ones you’ve been trying recently?

I see that -safeObjectForKey: is from an external library. Are you importing it yourself, or getting it second-hand from another library? 

Given that lldb (but why not clang?) objects to the declaration, which doesn't persist into the binary itself (it might into the .dSYM), try preprocessing your problem source file (Product > Perform Action > Preprocess “…”) and searching it for "safeObjectForKey". If you find the two declarations lldb complains about, you’re on your way to a solution.

Something else I’m curious about — do a “po [URLcomponentDict class]”. What class is it? The fact that po results in calling the “safe” access instead of the native one is curious. Perhaps someone has overridden -objectForKey: along the way?

— 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: using po in debugger Xcode 5.1.1
      • From: Owen Hartnett <email@hidden>
    • Re: using po in debugger Xcode 5.1.1
      • From: Roland King <email@hidden>
    • Re: using po in debugger Xcode 5.1.1
      • From: Alex Zavatone <email@hidden>
References: 
 >using po in debugger Xcode 5.1.1 (From: Owen Hartnett <email@hidden>)

  • Prev by Date: Re: debugging unrecognized selector
  • Next by Date: Re: using po in debugger Xcode 5.1.1
  • Previous by thread: using po in debugger Xcode 5.1.1
  • Next by thread: Re: using po in debugger Xcode 5.1.1
  • Index(es):
    • Date
    • Thread