Why the crash ran into the assembly, and the PO couldn't hit the value of the object

Source: Internet
Author: User

In the Obj-c series, we briefly introduced some of the grammar of Obj-c and the use of some standard classes in the F library, but the actual writing of the app to get the shot has to be honest on OS X with Xcode. Recently on the internet inadvertently found there are also support OS X and iOS Ruby framework Ah, the hand is itchy. In addition Swift also launched, Xcode6.0beta also installed, this world temptation is more ah. However, in this series of it is still a sincere record of the use of Xcode in the process of problems and solutions.

Ok. To get back to the point, when using Xcode6beta (hereinafter all referred to as x6b), found to set a breakpoint, interrupted to jump directly to the assembly view, this is not the average person needs oh (although this cat is not ordinary people, is a special cat ah.) In fact, this is can be set, oh, after the break of the breakpoint, after selecting Debug->debug workflow in the menu, will always show the assembly line tick off:


When this is interrupted again, the source line can correctly display the bird:


We know that the Lldb debugger is used in the background when debugging x6b, and we can use a lot of debug commands to view and set the values of variables in the code (similar to the VS environment) when debugging, see the Red box section above. This is the area. But I'm typing po val_name in debug area but I'm showing an error:

(LLDB) PO now

Error:warning:couldn ' t get cmd pointer (substituting NULL): Extracting data from value failed

Couldn ' t materialize:couldn ' t get the value of variable Now:no location, value may has been optimized out

Errored out in Execute, couldn ' t preparetoexecutejitexpression

What happened, in fact, this is because your project compiled target type is release instead of debug, because there is no additional debugging information of the object, natural display does not come out, the solution is very simple in the x6b menu, select Prouct->scheme->edit Scheme :


Then change the release to debug on the pop-up window:


Then you can see the object content using the PO command in LLDB:

(LLDB) PO now

2014-07-04 09:45:19 +0000

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.