Index: kernel/generic/src/console/cmd.c
===================================================================
--- kernel/generic/src/console/cmd.c	(revision e2b762ec7955698a156a39c44cbaacd7211758b2)
+++ kernel/generic/src/console/cmd.c	(revision f3f700969f3b6eb1e83490a13926412f32c7bf6c)
@@ -65,8 +65,6 @@
 #include <ipc/ipc.h>
 #include <ipc/irq.h>
-
-#ifdef CONFIG_SYMTAB
 #include <symtab.h>
-#endif
+#include <errno.h>
 
 #ifdef CONFIG_TEST
@@ -171,5 +169,4 @@
 };
 
-#ifdef CONFIG_SYMTAB
 /* Data and methods for 'symaddr' command. */
 static int cmd_symaddr(cmd_arg_t *argv);
@@ -187,5 +184,4 @@
 	.argv = &symaddr_argv
 };
-#endif
 
 static char set_buf[MAX_CMDLINE+1];
@@ -464,7 +460,5 @@
 	&set4_info,
 	&slabs_info,
-#ifdef CONFIG_SYMTAB
 	&symaddr_info,
-#endif
 	&sched_info,
 	&threads_info,
@@ -613,6 +607,4 @@
 }
 
-#ifdef CONFIG_SYMTAB
-
 /** Search symbol table */
 int cmd_symaddr(cmd_arg_t *argv)
@@ -623,26 +615,29 @@
 }
 
-#endif
-
 /** Call function with zero parameters */
 int cmd_call0(cmd_arg_t *argv)
 {
-#ifdef CONFIG_SYMTAB
 	uintptr_t symaddr;
+	char *symbol;
 	unative_t (*fnc)(void);
 	fncptr_t fptr;
-
-	symaddr = get_symbol_addr((char *) argv->buffer);
-	if (!symaddr)
-		printf("Symbol %s not found.\n", argv->buffer);
-	else if (symaddr == (uintptr_t) -1) {
-		symtab_print_search((char *) argv->buffer);
+	int rc;
+
+	symbol = (char *) argv->buffer;
+	rc = symtab_addr_lookup(symbol, &symaddr);
+
+	if (rc == ENOENT)
+		printf("Symbol %s not found.\n", symbol);
+	else if (rc == EOVERFLOW) {
+		symtab_print_search(symbol);
 		printf("Duplicate symbol, be more specific.\n");
+	} else if (rc == EOK) {
+		fnc = (unative_t (*)(void)) arch_construct_function(&fptr,
+		    (void *) symaddr, (void *) cmd_call0);
+		printf("Calling %s() (%p)\n", symbol, symaddr);
+		printf("Result: %#" PRIxn "\n", fnc());
 	} else {
-		fnc = (unative_t (*)(void)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call0);
-		printf("Calling %s() (%p)\n", argv->buffer, symaddr);
-		printf("Result: %#" PRIxn "\n", fnc());
-	}
-#endif
+		printf("No symbol information available.\n");
+	}
 	return 1;
 }
@@ -680,5 +675,4 @@
 int cmd_call1(cmd_arg_t *argv)
 {
-#ifdef CONFIG_SYMTAB
 	uintptr_t symaddr;
 	char *symbol;
@@ -686,19 +680,22 @@
 	unative_t arg1 = argv[1].intval;
 	fncptr_t fptr;
-	
-	symaddr = get_symbol_addr((char *) argv->buffer);
-
-	if (!symaddr)
-		printf("Symbol %s not found.\n", argv->buffer);
-	else if (symaddr == (uintptr_t) -1) {
-		symtab_print_search((char *) argv->buffer);
+	int rc;
+
+	symbol = (char *) argv->buffer;
+	rc = symtab_addr_lookup(symbol, &symaddr);
+
+	if (rc == ENOENT) {
+		printf("Symbol %s not found.\n", symbol);
+	} else if (rc == EOVERFLOW) {
+		symtab_print_search(symbol);
 		printf("Duplicate symbol, be more specific.\n");
-	} else {
-		symbol = get_symtab_entry(symaddr);
+	} else if (rc == EOK) {
 		fnc = (unative_t (*)(unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call1);
 		printf("Calling f(%#" PRIxn "): %p: %s\n", arg1, symaddr, symbol);
 		printf("Result: %#" PRIxn "\n", fnc(arg1));
-	}
-#endif
+	} else {
+		printf("No symbol information available.\n");
+	}
+
 	return 1;
 }
@@ -707,5 +704,4 @@
 int cmd_call2(cmd_arg_t *argv)
 {
-#ifdef CONFIG_SYMTAB
 	uintptr_t symaddr;
 	char *symbol;
@@ -714,19 +710,22 @@
 	unative_t arg2 = argv[2].intval;
 	fncptr_t fptr;
-	
-	symaddr = get_symbol_addr((char *) argv->buffer);
-	if (!symaddr)
-		printf("Symbol %s not found.\n", argv->buffer);
-	else if (symaddr == (uintptr_t) -1) {
-		symtab_print_search((char *) argv->buffer);
+	int rc;
+
+	symbol = (char *) argv->buffer;
+	rc = symtab_addr_lookup(symbol, &symaddr);
+
+	if (rc == ENOENT) {
+		printf("Symbol %s not found.\n", symbol);
+	} else if (rc == EOVERFLOW) {
+		symtab_print_search(symbol);
 		printf("Duplicate symbol, be more specific.\n");
-	} else {
-		symbol = get_symtab_entry(symaddr);
+	} else if (rc == EOK) {
 		fnc = (unative_t (*)(unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call2);
 		printf("Calling f(%#" PRIxn ", %#" PRIxn "): %p: %s\n", 
 		       arg1, arg2, symaddr, symbol);
 		printf("Result: %#" PRIxn "\n", fnc(arg1, arg2));
-	}	
-#endif
+	} else {
+		printf("No symbol information available.\n");
+	}
 	return 1;
 }
@@ -735,5 +734,4 @@
 int cmd_call3(cmd_arg_t *argv)
 {
-#ifdef CONFIG_SYMTAB
 	uintptr_t symaddr;
 	char *symbol;
@@ -743,19 +741,22 @@
 	unative_t arg3 = argv[3].intval;
 	fncptr_t fptr;
-	
-	symaddr = get_symbol_addr((char *) argv->buffer);
-	if (!symaddr)
-		printf("Symbol %s not found.\n", argv->buffer);
-	else if (symaddr == (uintptr_t) -1) {
-		symtab_print_search((char *) argv->buffer);
+	int rc;
+	
+	symbol = (char *) argv->buffer;
+	rc = symtab_addr_lookup(symbol, &symaddr);
+
+	if (rc == ENOENT) {
+		printf("Symbol %s not found.\n", symbol);
+	} else if (rc == EOVERFLOW) {
+		symtab_print_search(symbol);
 		printf("Duplicate symbol, be more specific.\n");
-	} else {
-		symbol = get_symtab_entry(symaddr);
+	} else if (rc == EOK) {
 		fnc = (unative_t (*)(unative_t, unative_t, unative_t, ...)) arch_construct_function(&fptr, (void *) symaddr, (void *) cmd_call3);
 		printf("Calling f(%#" PRIxn ",%#" PRIxn ", %#" PRIxn "): %p: %s\n", 
 		       arg1, arg2, arg3, symaddr, symbol);
 		printf("Result: %#" PRIxn "\n", fnc(arg1, arg2, arg3));
-	}
-#endif
+	} else {
+		printf("No symbol information available.\n");
+	}
 	return 1;
 }
@@ -807,39 +808,32 @@
 int cmd_set4(cmd_arg_t *argv)
 {
-	uint32_t *addr;
+	uintptr_t addr;
 	uint32_t arg1 = argv[1].intval;
 	bool pointer = false;
+	int rc;
 
 	if (((char *)argv->buffer)[0] == '*') {
-#ifdef CONFIG_SYMTAB
-		addr = (uint32_t *) get_symbol_addr((char *) argv->buffer + 1);
-#else
-		addr = 0;
-#endif
+		rc = symtab_addr_lookup((char *) argv->buffer + 1, &addr);
 		pointer = true;
 	} else if (((char *) argv->buffer)[0] >= '0' && 
 		   ((char *)argv->buffer)[0] <= '9') {
-		addr = (uint32_t *)atoi((char *)argv->buffer);
+		rc = EOK;
+		addr = atoi((char *)argv->buffer);
 	} else {
-#ifdef CONFIG_SYMTAB
-		addr = (uint32_t *)get_symbol_addr((char *) argv->buffer);
-#else
-		addr = 0;
-#endif
-	}
-
-	if (!addr)
+		rc = symtab_addr_lookup((char *) argv->buffer, &addr);
+	}
+
+	if (rc == ENOENT)
 		printf("Symbol %s not found.\n", argv->buffer);
-	else if (addr == (uint32_t *) -1) {
-#ifdef CONFIG_SYMTAB
+	else if (rc == EOVERFLOW) {
 		symtab_print_search((char *) argv->buffer);
-#endif
 		printf("Duplicate symbol, be more specific.\n");
+	} else if (rc == EOK) {
+		if (pointer)
+			addr = *(uintptr_t *) addr;
+		printf("Writing %#" PRIx64 " -> %p\n", arg1, addr);
+		*(uint32_t *) addr = arg1;
 	} else {
-		if (pointer)
-			addr = (uint32_t *)(*(unative_t *)addr);
-		printf("Writing %#" PRIx64 " -> %p\n", arg1, addr);
-		*addr = arg1;
-		
+		printf("No symbol information available.\n");
 	}
 	
