changeset 269:632667d95d35

Improve message not implemented error message
author Michael Pavone <pavone@retrodev.com>
date Fri, 18 Jul 2014 19:31:07 -0700
parents 123e9468d55e
children b74956a2196f
files runtime/proghead.inc
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/proghead.inc	Fri Jul 18 09:55:19 2014 -0700
+++ b/runtime/proghead.inc	Fri Jul 18 19:31:07 2014 -0700
@@ -10,8 +10,17 @@
 
 object * no_impl(uint32_t method_id, uint32_t num_args, object * self, va_list args)
 {
+	uint32_t *cur;
+	int slot;
 	fprintf(stderr, "method %s(%d) is not implemented on object %p\n", methodNames[method_id], method_id, self);
-	fprintf(stderr, "main_module %p\n", main_module);
+	fputs("Object implements:\n", stderr);
+	for (slot = 0; slot < 16; slot++) {
+		if (self->meta->methods[slot]) {
+			for (cur = self->meta->methods[slot]; *cur != LAST_METHOD; cur++) {
+				fprintf(stderr, "\t%s\n", methodNames[*cur]);
+			}
+		}
+	}
 	exit(1);
 	return NULL;
 }