improve debug output

This commit is contained in:
Richard Frith-Macdonald 2019-08-09 11:06:17 +01:00
parent dd36855923
commit d497c7b3ea
3 changed files with 27 additions and 4 deletions

View file

@ -1,3 +1,11 @@
2019-08-09 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSRunLoop.m:
* Source/NSThread.m:
Improve reporting of excess performers so that, when one thread
performs selectors in another, you can see the class of the receiver
and the selector involved.
2019-08-08 Richard Frith-Macdonald <rfm@gnu.org>
* configure.ac: check for malloc_usable_sizer()

View file

@ -1537,10 +1537,19 @@ updateTimer(NSTimer *t, NSDate *d, NSTimeInterval now)
if (i % 1000 == 0 && i > context->maxPerformers)
{
context->maxPerformers = i;
NSLog(@"WARNING ... there are %u performers scheduled"
@" in mode %@ of %@\n(Latest: [%@ %@])",
i, mode, self, NSStringFromClass([target class]),
NSStringFromSelector(aSelector));
if (sel_isEqual(aSelector, @selector(fire)))
{
NSLog(@"WARNING ... there are %u performers scheduled"
@" in mode %@ of %@\n(Latest: fires %@)",
i, mode, self, target);
}
else
{
NSLog(@"WARNING ... there are %u performers scheduled"
@" in mode %@ of %@\n(Latest: [%@ %@])",
i, mode, self, NSStringFromClass([target class]),
NSStringFromSelector(aSelector));
}
}
}
RELEASE(item);

View file

@ -2026,6 +2026,12 @@ GSRunLoopInfoForThread(NSThread *aThread)
GSNOSUPERDEALLOC;
}
- (NSString*) description
{
return [[super description] stringByAppendingFormat: @" [%s %s]",
class_getName(object_getClass(receiver)), sel_getName(selector)];
}
- (void) fire
{
GSRunLoopThreadInfo *threadInfo;