* Made vm_area_lookup() part of the kernel private API.

* "sc"/"where"/"bt" now prints the area where the function of the stack frame
  is located in case there is no other information (using the above function).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19800 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-01-14 23:26:20 +00:00
parent f4972679f7
commit f39acd678c
3 changed files with 21 additions and 11 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2005, Axel Dörfler, [email protected]. All rights reserved. * Copyright 2002-2007, Axel Dörfler, [email protected]. All rights reserved.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
@@ -9,7 +9,6 @@
#define _KERNEL_VM_H #define _KERNEL_VM_H
//#include <kernel.h>
#include <vm_types.h> #include <vm_types.h>
#include <arch/vm.h> #include <arch/vm.h>
#include <arch/vm_translation_map.h> #include <arch/vm_translation_map.h>
@@ -58,6 +57,7 @@ area_id vm_clone_area(team_id team, const char *name, void **address,
area_id sourceArea); area_id sourceArea);
status_t vm_delete_area(team_id aid, area_id id); status_t vm_delete_area(team_id aid, area_id id);
status_t vm_create_vnode_cache(void *vnode, vm_cache_ref **_cacheRef); status_t vm_create_vnode_cache(void *vnode, vm_cache_ref **_cacheRef);
vm_area *vm_area_lookup(vm_address_space *addressSpace, addr_t address);
status_t vm_set_area_memory_type(area_id id, addr_t physicalBase, uint32 type); status_t vm_set_area_memory_type(area_id id, addr_t physicalBase, uint32 type);
+17 -7
View File
@@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2005, Axel Dörfler, [email protected]. * Copyright 2002-2007, Axel Dörfler, [email protected].
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
* *
* Copyright 2001, Travis Geiselbrecht. All rights reserved. * Copyright 2001, Travis Geiselbrecht. All rights reserved.
@@ -12,6 +12,7 @@
#include <kernel.h> #include <kernel.h>
#include <kimage.h> #include <kimage.h>
#include <thread.h> #include <thread.h>
#include <vm.h>
#include <arch/debug.h> #include <arch/debug.h>
#include <arch_cpu.h> #include <arch_cpu.h>
@@ -91,16 +92,25 @@ print_stack_frame(struct thread *thread, addr_t eip, addr_t ebp, addr_t nextEbp)
status = image_debug_lookup_user_symbol_address(thread->team, eip, status = image_debug_lookup_user_symbol_address(thread->team, eip,
&baseAddress, &symbol, &image, &exactMatch); &baseAddress, &symbol, &image, &exactMatch);
} }
kprintf("%08lx (+%4ld) %08lx", ebp, diff, eip);
if (status == B_OK) { if (status == B_OK) {
if (symbol != NULL) { if (symbol != NULL) {
kprintf("%08lx (+%4ld) %08lx <%s>:%s + 0x%04lx%s\n", ebp, diff, eip, kprintf(" <%s>:%s + 0x%04lx%s\n", image, symbol,
image, symbol, eip - baseAddress, exactMatch ? "" : " (nearest)"); eip - baseAddress, exactMatch ? "" : " (nearest)");
} else { } else {
kprintf("%08lx (+%4ld) %08lx <%s@%p>:unknown + 0x%04lx\n", ebp, diff, kprintf(" <%s@%p>:unknown + 0x%04lx\n", image,
eip, image, (void *)baseAddress, eip - baseAddress); (void *)baseAddress, eip - baseAddress);
} }
} else } else {
kprintf("%08lx (+%4ld) %08lx\n", ebp, diff, eip); vm_area *area = vm_area_lookup(thread->team->address_space, eip);
if (area != NULL) {
kprintf(" %ld:%s@%p + %#lx\n", area->id, area->name, (void *)area->base,
eip - area->base);
} else
kprintf("\n");
}
} }
+2 -2
View File
@@ -2961,8 +2961,8 @@ vm_soft_fault(addr_t originalAddress, bool isWrite, bool isUser)
} }
/* NOTE: must have the address space's sem held */ /*! You must have the address space's sem held */
static vm_area * vm_area *
vm_area_lookup(vm_address_space *addressSpace, addr_t address) vm_area_lookup(vm_address_space *addressSpace, addr_t address)
{ {
vm_area *area; vm_area *area;