Debugger Basics,
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