http://lldb.llvm.org/lldb-gdb.html shows me a wonderful number of things at my disposal that I never knew existed in gdb.
The current command of interest is the replacement for gdb's info symbol command which shows "information for a raw address in the executable or any shared libraries"
That replacement in lldb is image lookup(gdb) info symbol 0xa0b06174
(lldb) image lookup --address 0x1ec4I highly recommend all Objective-C programmers skim http://lldb.llvm.org/lldb-gdb.html aka The LLDB Debugger command map and smile at all that you have available!
Update:
We ended up switching back to gdb.
We were able to see the offending code once we switched back to gdb from lldb and applied what we could from http://coderslike.us/2009/05/05/finding-freeddeallocated-instances-of-objects/
The solution to the memory issue was:
We were able to see the offending code once we switched back to gdb from lldb and applied what we could from http://coderslike.us/2009/05/05/finding-freeddeallocated-instances-of-objects/
The solution to the memory issue was:
- create a UIColor
- store that in a variable such as someUIColor
- pull out from someUIColor.CGColor the CGColorRef and pass that on to whatever needs it
It seems that doing something like this is bad in ARC and one should use UIColor (which is an NSObject):
CGColorRef crashingColor = [[UIColor colorWithRed:1 green:1 blue:160.0/255.0 alpha:1] CGColor];
This comment has been removed by the author.
ReplyDeleteIt may be that this shows up only when a non-ARC enabled piece is a few lines down that uses the crashingColor and so ARC allows the memory to be dealloc'ed
ReplyDelete