Index: kernel/generic/src/debug/symtab.c
===================================================================
--- kernel/generic/src/debug/symtab.c	(revision b1c57a828cb73794beb6a309f5ec0199ca75ecc2)
+++ kernel/generic/src/debug/symtab.c	(revision 6b00876f80fd8b04056ef87fa070ac2da14ca41c)
@@ -202,106 +202,38 @@
 }
 
-/** Symtab completion
- *
- * @param input Search string, completes to symbol name
- * @param size  Input buffer size
- *
- * @return 0 - nothing found, 1 - success, >1 print duplicates
- *
- */
-int symtab_compl(char *input, size_t size, indev_t *indev)
-{
-#ifdef CONFIG_SYMTAB
-	const char *name = input;
-	
-	/* Allow completion of pointers */
-	if ((name[0] == '*') || (name[0] == '&'))
-		name++;
-	
-	/* Do not print all symbols */
-	if (str_length(name) == 0)
-		return 0;
-	
-	size_t found = 0;
-	size_t pos = 0;
-	const char *hint;
-	char output[MAX_SYMBOL_NAME];
-	
-	/*
-	 * Maximum Match Length: Length of longest matching common substring in
-	 * case more than one match is found.
-	 */
-	size_t max_match_len = size;
-	size_t max_match_len_tmp = size;
-	size_t input_len = str_length(input);
-	char *sym_name;
-	size_t hints_to_show = MAX_TAB_HINTS - 1;
-	size_t total_hints_shown = 0;
-	bool continue_showing_hints = true;
-	
-	output[0] = 0;
-	
-	while ((hint = symtab_search_one(name, &pos)))
-		pos++;
-	
-	pos = 0;
-	
-	while ((hint = symtab_search_one(name, &pos))) {
-		if ((found == 0) || (str_length(output) > str_length(hint)))
-			str_cpy(output, MAX_SYMBOL_NAME, hint);
-		
-		pos++;
-		found++;
-	}
-	
-	/*
-	 * If the number of possible completions is more than MAX_TAB_HINTS,
-	 * ask the user whether to display them or not.
-	 */
-	if (found > MAX_TAB_HINTS) {
-		printf("\n");
-		continue_showing_hints =
-		    console_prompt_display_all_hints(indev, found);
-	}
-	
-	if ((found > 1) && (str_length(output) != 0)) {
-		printf("\n");
-		pos = 0;
-		while (symtab_search_one(name, &pos)) {
-			sym_name = symbol_table[pos].symbol_name;
-			pos++;
-			
-			if (continue_showing_hints) {
-				/* We are still showing hints */
-				printf("%s\n", sym_name);
-				--hints_to_show;
-				++total_hints_shown;
-				
-				if ((hints_to_show == 0) && (total_hints_shown != found)) {
-					/* Ask the user to continue */
-					continue_showing_hints =
-					    console_prompt_more_hints(indev, &hints_to_show);
-				}
-			}
-			
-			for (max_match_len_tmp = 0;
-			    (output[max_match_len_tmp] ==
-			    sym_name[input_len + max_match_len_tmp]) &&
-			    (max_match_len_tmp < max_match_len); ++max_match_len_tmp);
-			
-			max_match_len = max_match_len_tmp;
+/** Symtab completion enum, see kernel/generic/include/kconsole.h */
+const char* symtab_hints_enum(const char *input, const char **help,
+    void **ctx)
+{
+#ifdef CONFIG_SYMTAB
+	size_t len = str_length(input);
+	struct symtab_entry **entry = (struct symtab_entry**)ctx;
+	
+	if (*entry == NULL)
+		*entry = symbol_table;
+	
+	for (; (*entry)->address_le; (*entry)++) {
+		const char *curname = (*entry)->symbol_name;
+		
+		/* Find a ':' in curname */
+		const char *colon = str_chr(curname, ':');
+		if (colon == NULL)
+			continue;
+		
+		if (str_length(curname) < len)
+			continue;
+		
+		if (str_lcmp(input, curname, len) == 0) {
+			(*entry)++;
+			if (help)
+				*help = NULL;
+			return (curname + str_lsize(curname, len));
 		}
-		
-		/* Keep only the characters common in all completions */
-		output[max_match_len] = 0;
-	}
-	
-	if (found > 0)
-		str_cpy(input, size, output);
-	
-	return found;
-	
-#else
-	return 0;
+	}
+	
+	return NULL;
+	
+#else
+	return NULL;
 #endif
 }
