Skip to content

Commit 0b88c8e

Browse files
mulle-natCopilot
andcommitted
fix: class dependency diagnostic drops categoryid in waitqueue output
mulle_objc_loadclass_print_unfulfilled_dependency always printed "waiting for class" even when the unfulfilled dependency was on a category (classid + categoryid). The categoryid was silently discarded, making diagnostics misleading — e.g. "NSBundle waiting for class MulleObjCDeps" when MulleObjCDeps the class IS loaded and the actual blocker is a stuck MulleObjCDeps category. Mirror the same class/category branching that mulle_objc_loadcategory_print_unfulfilled_dependency already does correctly: print "waiting for class" when categoryid is MULLE_OBJC_NO_CATEGORYID, and "waiting for category" with full "Class( Category)" notation otherwise. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 648534b commit 0b88c8e

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

src/mulle-objc-load.c

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,7 @@ void
429429
struct _mulle_objc_dependency dependency;
430430
struct _mulle_objc_infraclass *infra;
431431
char *s_class;
432+
char *s_category;
432433

433434
if( ! info || ! universe)
434435
return;
@@ -438,17 +439,37 @@ void
438439
return;
439440

440441
s_class = _mulle_objc_universe_describe_classid( universe, dependency.classid);
441-
if( universe->debug.print.stuck_class_coverage)
442-
printf( "%08lx;%s;;\n", (unsigned long) dependency.classid, s_class);
442+
if( dependency.categoryid == MULLE_OBJC_NO_CATEGORYID)
443+
{
444+
if( universe->debug.print.stuck_class_coverage)
445+
printf( "%08lx;%s;;\n", (unsigned long) dependency.classid, s_class);
446+
447+
if( universe->debug.trace.waiters_svg)
448+
mulle_fprintf( stderr, "\t\"%s\" -> \"%s\" [ label=\" waits for\" ]\n",
449+
info->classname,
450+
s_class);
451+
else
452+
mulle_fprintf( stderr, "\t%08lx \"%s\" -> %08lx \"%s\" [ label=\" waiting for class\" ]\n",
453+
(unsigned long) info->classid, info->classname,
454+
(unsigned long) dependency.classid, s_class);
455+
return;
456+
}
457+
458+
s_category = _mulle_objc_universe_describe_categoryid( universe, dependency.categoryid);
459+
if( universe->debug.print.stuck_category_coverage)
460+
printf( "%08lx;%s;%08lx;%s\n", (unsigned long) dependency.classid, s_class,
461+
(unsigned long) dependency.categoryid, s_category);
443462

444463
if( universe->debug.trace.waiters_svg)
445-
mulle_fprintf( stderr, "\t\"%s\" -> \"%s\" [ label=\" waits for\" ]\n",
464+
mulle_fprintf( stderr, "\t\"%s\" -> \"%s( %s)\" [ label=\" waits for\" ]\n",
446465
info->classname,
447-
s_class);
466+
s_class,
467+
s_category);
448468
else
449-
mulle_fprintf( stderr, "\t%08lx \"%s\" -> %08lx \"%s\" [ label=\" waiting for class\" ]\n",
469+
mulle_fprintf( stderr, "\t%08lx \"%s\" -> %08lx,%08lx \"%s( %s)\" [ label=\" waiting for category\" ]\n",
450470
(unsigned long) info->classid, info->classname,
451-
(unsigned long) dependency.classid, s_class);
471+
(unsigned long) dependency.classid, (unsigned long) dependency.categoryid,
472+
s_class, s_category);
452473
}
453474

454475

0 commit comments

Comments
 (0)