- vaddr = DB_USER_STACK_ADDR;
- kaddr = 0;
-
- /*
- * skip nulls at the end
- */
- if (db_search_null(task, &vaddr, DB_NAME_SEARCH_LIMIT, &kaddr, 0) < 0) {
- db_printf(DB_NULL_TASK_NAME);
- return;
- }
- /*
- * search start of args
- */
- if (db_search_null(task, &vaddr, DB_NAME_SEARCH_LIMIT, &kaddr, 1) < 0) {
- db_printf(DB_NULL_TASK_NAME);
- return;
- }
-
- n = DB_TASK_NAME_LEN-1;
- p = (char *)kaddr + sizeof(unsigned);
- for (vaddr += sizeof(int); vaddr < DB_USER_STACK_ADDR && n > 0;
- vaddr++, p++, n--) {
- if (vaddr % PPC_PGBYTES == 0) {
- if (db_user_to_kernel_address(task, vaddr, &kaddr, 0) <0)
- return;
- p = (char*)kaddr;
- }
- db_printf("%c", (*p < ' ' || *p > '~')? ' ': *p);
+ p = 0;
+ tname[0] = 0;
+
+ if(task->bsd_info) p = getProcName((struct proc *)(task->bsd_info)); /* Point to task name */
+
+ if(p) {
+ for(i = 0; i < 32; i++) { /* Move no more than 32 bytes */
+ tname[i] = p[i];
+ if(p[i] == 0) break;
+ }
+ tname[i] = 0;
+ db_printf("%s", tname);