Inspecting any variable, evaluating any expression with lldb broken #335

Open
rhgills opened this Issue Jul 10, 2012 · 0 comments

Projects

None yet

1 participant

@rhgills
rhgills commented Jul 10, 2012

With the current version of ASIHTTPRequest.m, you can't use po or expr inside ASIHTTPRequest when using lldb. Instead, several error messages of the following format are printed:

error: instance method 'delegate' has incompatible result types in different translation units ('objc_object *' vs. 'id')

Luckily, the fix is simple. Change the dynamic accessors for queue, delegate, uploadProgressDelegate and downloadProgressDelegate to get/set variables with the proper protocol. For example, for queue:

Original:

- (id)queue
{
[[self cancelledLock] lock];
id q = queue;
[[self cancelledLock] unlock];
return q;
}


- (void)setQueue:(id)newQueue
{
[[self cancelledLock] lock];
if (newQueue != queue) {
    [queue release];
    queue = [newQueue retain];
}
[[self cancelledLock] unlock];
} 

Fixed:

- (id <ASIHTTPRequestDelegate, ASIProgressDelegate>)queue
{
[[self cancelledLock] lock];
id q = queue;
[[self cancelledLock] unlock];
return q;
}


- (void)setQueue:(id <ASIHTTPRequestDelegate, ASIProgressDelegate>)newQueue
{
[[self cancelledLock] lock];
if (newQueue != queue) {
    [queue release];
    queue = [newQueue retain];
}
[[self cancelledLock] unlock];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment