• 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
Debugger Basics,
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Debugger Basics,


  • Subject: Debugger Basics,
  • From: Andreas Grosam <email@hidden>
  • Date: Fri, 20 Apr 2012 13:37:33 +0200

Using LLDB.

I set a breakpoint within a Block which is called from within a method:

    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0),
    ^{
        NSError* error;
        NSData* data = [[NSData alloc] initWithContentsOfURL:self.tempFileURL
                                                     options:NSDataReadingMappedIfSafe | NSDataReadingUncached
                                                       error:&error];
        ...


How do we refer to 'self' in the debugger console in order to retrieve a property and print it? In this case tempFileURL. (Note, this property will also be referenced from within the block)

While the debugger stopped at the breakpoint within the Block:

(lldb) po self.tempFileURL
error: use of undeclared identifier 'self'




LLDB's variable pane does not show *any* values. However, there is this:

.block_descriptor	__block_literal_14 *
__isa	void *
__flags	int
__reserved	int
__FuncPtr	void *
__descriptor	__block_descriptor_withcopydispose *
self	NSURLConnectionDownloadViewController *
…


NSURLConnectionDownloadViewController is 'self' and actually a member of the block. Any attempt to refer to self via block_descriptor.self also only causes "expression error" in lldb.

(lldb) po [.block_descriptor.self tempFileURL]
error: expected expression
error: 1 errors parsing expression



Thanks in advance for hints!


Regards
Andreas
 _______________________________________________
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: Debugger Basics,
      • From: Fritz Anderson <email@hidden>
  • Prev by Date: Re: Serious Issue: References To Products Lost / Wrong Dependency Evaluation
  • Next by Date: Re: Displaying another page/view on button click
  • Previous by thread: Re: Serious Issue: References To Products Lost / Wrong Dependency Evaluation
  • Next by thread: Re: Debugger Basics,
  • Index(es):
    • Date
    • Thread