[lldb-dev] Mac OS X Apple applications debugging. Switching from GDB to LLDB ?

Aurelien Hugele altimac at carrafix.com
Sat Mar 2 10:38:18 PST 2013


I'm in fact not interested in NSObject alloc, but other instance method ;) and it does not work either.
Anyway "breakpoint set -S alloc"   should work for class and instance methods.

Remember the problem is not in *my* app, but Apple apps...

On 2 mars 2013, at 19:33, Jean-Daniel Dupas <devlists at shadowlab.org> wrote:

> Le 2 mars 2013 à 18:43, Aurelien Hugele <altimac at carrafix.com> a écrit :
> 
>> Hi list!
>> 
>> I'm a GDB user that want to switch to LLDB, but something is preventing me to switch for the moment: I can't find how to debug (analyze) Apple applications such as Calendars.app or Contacts.app on Mac OS X.
>> 
>> Using GDB, i'm used to do something like this :
>> 
>>> $ gdb /Applications/Calendar.app
>>> (gdb) run     
>>> Starting program: /Applications/Calendar.app/Contents/MacOS/Calendar 
>>> Reading symbols for shared libraries ++++++++ ............
>>> (gdb) fb alloc
>>> [0] cancel
>>> [1] all
>>> 
>>> Non-debugging symbols:
>>> [2]    +[ABDeprecatedObject alloc]
>>> [3]    +[CALDate(Private) alloc]
>>> [4]    +[CalAutoCompleteOperation alloc]
>>> [5]    +[NSHashTable alloc]
>>> [6]    +[NSKnownKeysDictionary alloc]
>>> [7]    +[NSKnownKeysDictionary1 alloc]
>>> [8]    +[NSKnownKeysMappingStrategy alloc]
>>> [9]    +[NSKnownKeysMappingStrategy1 alloc]
>>> [10]    +[NSLeafProxy alloc]
>>> [11]    +[NSManagedObject alloc]
>>> [12]    +[NSMapTable alloc]
>>> [13]    +[NSObject alloc]
>>> [14]    +[NSPasteboard alloc]
>>> [15]    +[NSProxy alloc]
>>> [16]    +[NSTemporaryObjectID alloc]
>>> [17]    +[NSUserNotification alloc]
>>> [18]    +[_CDSnapshot alloc]
>>> [19]    +[_NSCoreManagedObjectID alloc]
>>> [20]    +[_NSFaultingMutableArray alloc]
>>> [21]    +[_NSFaultingMutableOrderedSet alloc]
>>> [22]    +[_NSFaultingMutableSet alloc]
>>> [23]    +[_PFBatchFaultingArray alloc]
>>> [24]    +[_PFCachedNumber alloc]
>>> [25]    +[_PFFetchedResultOrderedSetWrapper alloc]
>>> [26]    +[_PFString alloc]
>>> [27]    +[__CFHashTable alloc]
>>> [28]    +[__CFMapTable alloc]
>> 
>> I can then make GDB break on the method i'm interested in.
>> 
>> 
>> Using LLDB, i've not been able to do the same :
>> 
>>> $ lldb /Applications/Calendar.app
>>> (lldb) Current executable set to '/Applications/Calendar.app' (x86_64).
>>> (lldb) run
>>> Process 54986 launched: '/Applications/Calendar.app/Contents/MacOS/Calendar' (x86_64)
>>> 
>>> (lldb) breakpoint set -S alloc                     // i've also tried -n "-[NSObject alloc]
> 
> This is a class method, so should be '+' not '-'
> 
> (lldb) b +[NSObject alloc]
> Breakpoint 3: where = libobjc.A.dylib`+[NSObject alloc], address = 0x00007fff86c3676e
> 
> -- Jean-Daniel
> 
> 
> 
> 





More information about the lldb-dev mailing list