From 8fef8adb6e6d4991e6292075043bcad9c5c4e186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Tue, 2 Aug 2005 16:28:20 +0000 Subject: [PATCH] Replaced all dprintf() calls from the kernel debugger with kprintf() calls. (there might be some more left, but it's not urgent or fatal) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13884 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/arch/x86/arch_debug.c | 34 +++++------ src/system/kernel/elf.c | 78 ++++++++++++------------- src/system/kernel/port.c | 20 +++---- src/system/kernel/sem.c | 22 +++---- 4 files changed, 77 insertions(+), 77 deletions(-) diff --git a/src/system/kernel/arch/x86/arch_debug.c b/src/system/kernel/arch/x86/arch_debug.c index 3bbda9033f..90a3d76e86 100644 --- a/src/system/kernel/arch/x86/arch_debug.c +++ b/src/system/kernel/arch/x86/arch_debug.c @@ -64,28 +64,28 @@ stack_trace(int argc, char **argv) else frameStack = &gBootFrameStack; } else { - dprintf("not supported\n"); + kprintf("not supported\n"); return 0; } for (i = 0; i < frameStack->index; i++) { - dprintf("iframe %p (end = %p)\n", + kprintf("iframe %p (end = %p)\n", frameStack->frames[i], frameStack->frames[i] + 1); } // We don't have a thread pointer early in the boot process if (thread != NULL) { - dprintf("stack trace for thread 0x%lx \"%s\"\n", thread->id, thread->name); + kprintf("stack trace for thread 0x%lx \"%s\"\n", thread->id, thread->name); - dprintf(" kernel stack: %p to %p\n", + kprintf(" kernel stack: %p to %p\n", (void *)thread->kernel_stack_base, (void *)(thread->kernel_stack_base + KERNEL_STACK_SIZE)); if (thread->user_stack_base != 0) { - dprintf(" user stack: %p to %p\n", (void *)thread->user_stack_base, + kprintf(" user stack: %p to %p\n", (void *)thread->user_stack_base, (void *)(thread->user_stack_base + thread->user_stack_size)); } } - dprintf("frame caller :function + offset\n"); + kprintf("frame caller :function + offset\n"); read_ebp(ebp); for (;;) { @@ -101,18 +101,18 @@ stack_trace(int argc, char **argv) if (isIFrame) { struct iframe *frame = (struct iframe *)(ebp + 8); - dprintf("iframe at %p\n", frame); - dprintf(" eax 0x%-9x ebx 0x%-9x ecx 0x%-9x edx 0x%x\n", + kprintf("iframe at %p\n", frame); + kprintf(" eax 0x%-9x ebx 0x%-9x ecx 0x%-9x edx 0x%x\n", frame->eax, frame->ebx, frame->ecx, frame->edx); - dprintf(" esi 0x%-9x edi 0x%-9x ebp 0x%-9x esp 0x%x\n", + kprintf(" esi 0x%-9x edi 0x%-9x ebp 0x%-9x esp 0x%x\n", frame->esi, frame->edi, frame->ebp, frame->esp); - dprintf(" eip 0x%-9x eflags 0x%-9x", frame->eip, frame->flags); + kprintf(" eip 0x%-9x eflags 0x%-9x", frame->eip, frame->flags); if ((frame->error_code & 0x4) != 0) { // from user space - dprintf("user esp 0x%x", frame->user_esp); + kprintf("user esp 0x%x", frame->user_esp); } - dprintf("\n"); - dprintf(" vector: 0x%x, error code: 0x%x\n", frame->vector, frame->error_code); + kprintf("\n"); + kprintf(" vector: 0x%x, error code: 0x%x\n", frame->vector, frame->error_code); ebp = frame->ebp; } else { addr_t eip = ((struct stack_frame *)ebp)->return_address; @@ -128,20 +128,20 @@ stack_trace(int argc, char **argv) if (elf_lookup_symbol_address(eip, &baseAddress, &symbol, &image, &exactMatch) == B_OK) { if (symbol != NULL) { - dprintf("%08lx (+%4ld) %08lx <%s>:%s + 0x%04lx%s\n", ebp, diff, eip, + kprintf("%08lx (+%4ld) %08lx <%s>:%s + 0x%04lx%s\n", ebp, diff, eip, image, symbol, eip - baseAddress, exactMatch ? "" : " (nearest)"); } else { - dprintf("%08lx (+%4ld) %08lx <%s@%p>:unknown + 0x%04lx\n", ebp, diff, eip, + kprintf("%08lx (+%4ld) %08lx <%s@%p>:unknown + 0x%04lx\n", ebp, diff, eip, image, (void *)baseAddress, eip - baseAddress); } } else - dprintf("%08lx %08lx\n", ebp, eip); + kprintf("%08lx %08lx\n", ebp, eip); ebp = nextEbp; } if (already_visited(previousLocations, &last, &num, ebp)) { - dprintf("circular stack frame: %p!\n", (void *)ebp); + kprintf("circular stack frame: %p!\n", (void *)ebp); break; } if (ebp == 0) diff --git a/src/system/kernel/elf.c b/src/system/kernel/elf.c index c92c4e049b..634ffa3843 100644 --- a/src/system/kernel/elf.c +++ b/src/system/kernel/elf.c @@ -148,17 +148,17 @@ dump_address_info(int argc, char **argv) addr_t address, baseAddress; if (argc < 2) { - dprintf("not enough arguments\n"); + kprintf("not enough arguments\n"); return 0; } address = strtoul(argv[1], NULL, 16); if (elf_lookup_symbol_address(address, &baseAddress, &symbol, &imageName, &exactMatch) == B_OK) { - dprintf("%p = %s + 0x%lx (%s)%s\n", (void *)address, symbol, address - baseAddress, + kprintf("%p = %s + 0x%lx (%s)%s\n", (void *)address, symbol, address - baseAddress, imageName, exactMatch ? "" : " (nearest)"); } else - dprintf("There is no image loaded at this address!\n"); + kprintf("There is no image loaded at this address!\n"); return 0; } @@ -281,11 +281,11 @@ dump_symbols(int argc, char **argv) hash_close(sImagesHash, &iterator, false); if (image == NULL) - dprintf("No image covers 0x%lx in the kernel!\n", num); + kprintf("No image covers 0x%lx in the kernel!\n", num); } else { image = hash_lookup(sImagesHash, (void *)num); if (image == NULL) - dprintf("image 0x%lx doesn't exist in the kernel!\n", num); + kprintf("image 0x%lx doesn't exist in the kernel!\n", num); } } else { // look for image by name @@ -297,10 +297,10 @@ dump_symbols(int argc, char **argv) hash_close(sImagesHash, &iterator, false); if (image == NULL) - dprintf("No image \"%s\" found in kernel!\n", argv[1]); + kprintf("No image \"%s\" found in kernel!\n", argv[1]); } } else { - dprintf("usage: %s image_name/image_id/address_in_image\n", argv[0]); + kprintf("usage: %s image_name/image_id/address_in_image\n", argv[0]); return 0; } @@ -309,7 +309,7 @@ dump_symbols(int argc, char **argv) // dump symbols - dprintf("Symbols of image %ld \"%s\":\nAddress Type Size Name\n", image->id, image->name); + kprintf("Symbols of image %ld \"%s\":\nAddress Type Size Name\n", image->id, image->name); if (image->num_debug_symbols > 0) { // search extended debug symbol table (contains static symbols) @@ -320,7 +320,7 @@ dump_symbols(int argc, char **argv) || symbol->st_size >= image->text_region.size + image->data_region.size) continue; - dprintf("%08lx %s/%s %5ld %s\n", symbol->st_value + image->text_region.delta, + kprintf("%08lx %s/%s %5ld %s\n", symbol->st_value + image->text_region.delta, get_symbol_type_string(symbol), get_symbol_bind_string(symbol), symbol->st_size, image->debug_string_table + symbol->st_name); } @@ -336,7 +336,7 @@ dump_symbols(int argc, char **argv) || symbol->st_size >= image->text_region.size + image->data_region.size) continue; - dprintf("%08lx %s/%s %5ld %s\n", symbol->st_value + image->text_region.delta, + kprintf("%08lx %s/%s %5ld %s\n", symbol->st_value + image->text_region.delta, get_symbol_type_string(symbol), get_symbol_bind_string(symbol), symbol->st_size, SYMNAME(image, symbol)); } @@ -350,34 +350,34 @@ dump_symbols(int argc, char **argv) static void dump_elf_region(struct elf_region *region, const char *name) { - dprintf(" %s.id 0x%lx\n", name, region->id); - dprintf(" %s.start 0x%lx\n", name, region->start); - dprintf(" %s.size 0x%lx\n", name, region->size); - dprintf(" %s.delta %ld\n", name, region->delta); + kprintf(" %s.id 0x%lx\n", name, region->id); + kprintf(" %s.start 0x%lx\n", name, region->start); + kprintf(" %s.size 0x%lx\n", name, region->size); + kprintf(" %s.delta %ld\n", name, region->delta); } static void dump_image_info(struct elf_image_info *image) { - dprintf("elf_image_info at %p:\n", image); - dprintf(" next %p\n", image->next); - dprintf(" id 0x%lx\n", image->id); + kprintf("elf_image_info at %p:\n", image); + kprintf(" next %p\n", image->next); + kprintf(" id 0x%lx\n", image->id); dump_elf_region(&image->text_region, "text"); dump_elf_region(&image->data_region, "data"); - dprintf(" dynamic_ptr 0x%lx\n", image->dynamic_ptr); - dprintf(" needed %p\n", image->needed); - dprintf(" symhash %p\n", image->symhash); - dprintf(" syms %p\n", image->syms); - dprintf(" strtab %p\n", image->strtab); - dprintf(" rel %p\n", image->rel); - dprintf(" rel_len 0x%x\n", image->rel_len); - dprintf(" rela %p\n", image->rela); - dprintf(" rela_len 0x%x\n", image->rela_len); - dprintf(" pltrel %p\n", image->pltrel); - dprintf(" pltrel_len 0x%x\n", image->pltrel_len); + kprintf(" dynamic_ptr 0x%lx\n", image->dynamic_ptr); + kprintf(" needed %p\n", image->needed); + kprintf(" symhash %p\n", image->symhash); + kprintf(" syms %p\n", image->syms); + kprintf(" strtab %p\n", image->strtab); + kprintf(" rel %p\n", image->rel); + kprintf(" rel_len 0x%x\n", image->rel_len); + kprintf(" rela %p\n", image->rela); + kprintf(" rela_len 0x%x\n", image->rela_len); + kprintf(" pltrel %p\n", image->pltrel); + kprintf(" pltrel_len 0x%x\n", image->pltrel_len); - dprintf(" debug_symbols %p (%ld)\n", image->debug_symbols, image->num_debug_symbols); + kprintf(" debug_symbols %p (%ld)\n", image->debug_symbols, image->num_debug_symbols); } @@ -397,19 +397,19 @@ dump_image(int argc, char **argv) } else { image = hash_lookup(sImagesHash, (void *)num); if (image == NULL) - dprintf("image 0x%lx doesn't exist in the kernel!\n", num); + kprintf("image 0x%lx doesn't exist in the kernel!\n", num); else dump_image_info(image); } return 0; } - dprintf("loaded kernel images:\n"); + kprintf("loaded kernel images:\n"); hash_open(sImagesHash, &iterator); while ((image = hash_next(sImagesHash, &iterator)) != NULL) { - dprintf("%p (%ld) %s\n", image, image->id, image->name); + kprintf("%p (%ld) %s\n", image, image->id, image->name); } hash_close(sImagesHash, &iterator, false); @@ -423,14 +423,14 @@ static void dump_symbol(struct elf_image_info *image, struct Elf32_Sym *sym) { - dprintf("symbol at %p, in image %p\n", sym, image); + kprintf("symbol at %p, in image %p\n", sym, image); - dprintf(" name index %d, '%s'\n", sym->st_name, SYMNAME(image, sym)); - dprintf(" st_value 0x%x\n", sym->st_value); - dprintf(" st_size %d\n", sym->st_size); - dprintf(" st_info 0x%x\n", sym->st_info); - dprintf(" st_other 0x%x\n", sym->st_other); - dprintf(" st_shndx %d\n", sym->st_shndx); + kprintf(" name index %d, '%s'\n", sym->st_name, SYMNAME(image, sym)); + kprintf(" st_value 0x%x\n", sym->st_value); + kprintf(" st_size %d\n", sym->st_size); + kprintf(" st_info 0x%x\n", sym->st_info); + kprintf(" st_other 0x%x\n", sym->st_other); + kprintf(" st_shndx %d\n", sym->st_shndx); } #endif diff --git a/src/system/kernel/port.c b/src/system/kernel/port.c index 103805e627..b7d727beca 100644 --- a/src/system/kernel/port.c +++ b/src/system/kernel/port.c @@ -222,7 +222,7 @@ dump_port_list(int argc, char **argv) for (i = 0; i < sMaxPorts; i++) { if (sPorts[i].id >= 0) - dprintf("%p\tid: 0x%lx\t\tname: '%s'\n", &sPorts[i], sPorts[i].id, sPorts[i].name); + kprintf("%p\tid: 0x%lx\t\tname: '%s'\n", &sPorts[i], sPorts[i].id, sPorts[i].name); } return 0; } @@ -233,15 +233,15 @@ _dump_port_info(struct port_entry *port) { int32 count; - dprintf("PORT: %p\n", port); - dprintf(" name: \"%s\"\n", port->name); - dprintf(" owner: %#lx\n", port->owner); - dprintf(" capacity: %ld\n", port->capacity); + kprintf("PORT: %p\n", port); + kprintf(" name: \"%s\"\n", port->name); + kprintf(" owner: %#lx\n", port->owner); + kprintf(" capacity: %ld\n", port->capacity); get_sem_count(port->read_sem, &count); - dprintf(" read sem count: %ld\n", count); + kprintf(" read sem count: %ld\n", count); get_sem_count(port->write_sem, &count); - dprintf(" write sem count: %ld\n", count); - dprintf(" total count: %ld\n", port->total_count); + kprintf(" write sem count: %ld\n", count); + kprintf(" total count: %ld\n", port->total_count); } @@ -251,7 +251,7 @@ dump_port_info(int argc, char **argv) int i; if (argc < 2) { - dprintf("usage: port [id|name|address]\n"); + kprintf("usage: port [id|name|address]\n"); return 0; } @@ -267,7 +267,7 @@ dump_port_info(int argc, char **argv) } else { unsigned slot = num % sMaxPorts; if (sPorts[slot].id != (int)num) { - dprintf("port 0x%lx doesn't exist!\n", num); + kprintf("port 0x%lx doesn't exist!\n", num); return 0; } _dump_port_info(&sPorts[slot]); diff --git a/src/system/kernel/sem.c b/src/system/kernel/sem.c index 07028fb0fa..ec861a2cf3 100644 --- a/src/system/kernel/sem.c +++ b/src/system/kernel/sem.c @@ -86,7 +86,7 @@ dump_sem_list(int argc, char **argv) for (i = 0; i < sMaxSems; i++) { if (sSems[i].id >= 0) - dprintf("%p\tid: 0x%lx\t\tname: '%s'\n", &sSems[i], sSems[i].id, + kprintf("%p\tid: 0x%lx\t\tname: '%s'\n", &sSems[i], sSems[i].id, sSems[i].u.used.name); } return 0; @@ -96,17 +96,17 @@ dump_sem_list(int argc, char **argv) static void dump_sem(struct sem_entry *sem) { - dprintf("SEM: %p\n", sem); - dprintf("id: %ld\n", sem->id); + kprintf("SEM: %p\n", sem); + kprintf("id: %ld\n", sem->id); if (sem->id >= 0) { - dprintf("name: '%s'\n", sem->u.used.name); - dprintf("owner: 0x%lx\n", sem->u.used.owner); - dprintf("count: 0x%x\n", sem->u.used.count); - dprintf("queue: head %p tail %p\n", sem->u.used.queue.head, + kprintf("name: '%s'\n", sem->u.used.name); + kprintf("owner: 0x%lx\n", sem->u.used.owner); + kprintf("count: 0x%x\n", sem->u.used.count); + kprintf("queue: head %p tail %p\n", sem->u.used.queue.head, sem->u.used.queue.tail); } else { - dprintf("next: %p\n", sem->u.unused.next); - dprintf("next_id: %ld\n", sem->u.unused.next_id); + kprintf("next: %p\n", sem->u.unused.next); + kprintf("next_id: %ld\n", sem->u.unused.next_id); } } @@ -117,7 +117,7 @@ dump_sem_info(int argc, char **argv) int i; if (argc < 2) { - dprintf("sem: not enough arguments\n"); + kprintf("sem: not enough arguments\n"); return 0; } @@ -132,7 +132,7 @@ dump_sem_info(int argc, char **argv) } else { unsigned slot = num % sMaxSems; if (sSems[slot].id != (int)num) { - dprintf("sem 0x%lx doesn't exist!\n", num); + kprintf("sem 0x%lx doesn't exist!\n", num); return 0; } dump_sem(&sSems[slot]);