johnno1962 / Xtrace

Trace Objective-C method calls by class or instance
MIT License
1.83k stars 132 forks source link

awesome tool | made a few changes to get it to work for me #16

Open Daij-Djan opened 6 years ago

Daij-Djan commented 6 years ago

1. change

Extended array of methods best not to touch. Without that, xtrace causes an exception after a while: 'expection' being: _os_unfair_lock_recursive_abort

I added retainWeakReference, _tryRetain, autorelease, isEqual:, hash and I added back the dealloc related methods


see:

            else if ( name[0] == '.' ||
                     [nameStr isEqualToString:@"description"] || [nameStr hasPrefix:@"_description"] ||
                     [nameStr isEqualToString:@"isEqual:"] || [nameStr hasPrefix:@"hash"] ||
                     [nameStr isEqualToString:@"retainWeakReference"] || [nameStr isEqualToString:@"_tryRetain"] || [nameStr isEqualToString:@"retain"] || [nameStr isEqualToString:@"release"] || [nameStr isEqualToString:@"autorelease"] ||
                     [nameStr isEqualToString:@"_isDeallocating"] || [nameStr isEqualToString:@"dealloc"] || [nameStr hasPrefix:@"_dealloc"] )
                ; // best avoided

2. change

Made formatValue function not call isKindOfClass on proxy objects to avoid a crash when proxies implement isKindOfClass

other

Daij-Djan commented 6 years ago

edited changes

johnno1962 commented 6 years ago

Hi @Daij-Djan, Thanks for this and the tweet. Any chance you could make it into a PR?