* 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:
@@ -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.
|
||||
*
|
||||
* Copyright 2001-2002, Travis Geiselbrecht. All rights reserved.
|
||||
@@ -9,7 +9,6 @@
|
||||
#define _KERNEL_VM_H
|
||||
|
||||
|
||||
//#include <kernel.h>
|
||||
#include <vm_types.h>
|
||||
#include <arch/vm.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);
|
||||
status_t vm_delete_area(team_id aid, area_id id);
|
||||
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);
|
||||
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
* Copyright 2001, Travis Geiselbrecht. All rights reserved.
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <kernel.h>
|
||||
#include <kimage.h>
|
||||
#include <thread.h>
|
||||
#include <vm.h>
|
||||
|
||||
#include <arch/debug.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,
|
||||
&baseAddress, &symbol, &image, &exactMatch);
|
||||
}
|
||||
|
||||
kprintf("%08lx (+%4ld) %08lx", ebp, diff, eip);
|
||||
|
||||
if (status == B_OK) {
|
||||
if (symbol != NULL) {
|
||||
kprintf("%08lx (+%4ld) %08lx <%s>:%s + 0x%04lx%s\n", ebp, diff, eip,
|
||||
image, symbol, eip - baseAddress, exactMatch ? "" : " (nearest)");
|
||||
kprintf(" <%s>:%s + 0x%04lx%s\n", image, symbol,
|
||||
eip - baseAddress, exactMatch ? "" : " (nearest)");
|
||||
} else {
|
||||
kprintf("%08lx (+%4ld) %08lx <%s@%p>:unknown + 0x%04lx\n", ebp, diff,
|
||||
eip, image, (void *)baseAddress, eip - baseAddress);
|
||||
kprintf(" <%s@%p>:unknown + 0x%04lx\n", image,
|
||||
(void *)baseAddress, eip - baseAddress);
|
||||
}
|
||||
} else
|
||||
kprintf("%08lx (+%4ld) %08lx\n", ebp, diff, eip);
|
||||
} else {
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -2961,8 +2961,8 @@ vm_soft_fault(addr_t originalAddress, bool isWrite, bool isUser)
|
||||
}
|
||||
|
||||
|
||||
/* NOTE: must have the address space's sem held */
|
||||
static vm_area *
|
||||
/*! You must have the address space's sem held */
|
||||
vm_area *
|
||||
vm_area_lookup(vm_address_space *addressSpace, addr_t address)
|
||||
{
|
||||
vm_area *area;
|
||||
|
||||
Reference in New Issue
Block a user