Added elf_get_image_info_for_address() to get an image info for a kernel
image. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27300 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -31,6 +31,7 @@ status_t elf_debug_lookup_symbol_address(addr_t address, addr_t *_baseAddress,
|
|||||||
status_t elf_debug_lookup_user_symbol_address(struct team* team, addr_t address,
|
status_t elf_debug_lookup_user_symbol_address(struct team* team, addr_t address,
|
||||||
addr_t *_baseAddress, const char **_symbolName,
|
addr_t *_baseAddress, const char **_symbolName,
|
||||||
const char **_imageName, bool *_exactMatch);
|
const char **_imageName, bool *_exactMatch);
|
||||||
|
status_t elf_get_image_info_for_address(addr_t address, image_info* info);
|
||||||
status_t elf_init(struct kernel_args *args);
|
status_t elf_init(struct kernel_args *args);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -25,6 +25,7 @@
|
|||||||
#include <team.h>
|
#include <team.h>
|
||||||
#include <thread.h>
|
#include <thread.h>
|
||||||
#include <runtime_loader.h>
|
#include <runtime_loader.h>
|
||||||
|
#include <util/AutoLock.h>
|
||||||
#include <util/khash.h>
|
#include <util/khash.h>
|
||||||
#include <vfs.h>
|
#include <vfs.h>
|
||||||
#include <vm.h>
|
#include <vm.h>
|
||||||
@@ -1819,6 +1820,33 @@ unload_kernel_add_on(image_id id)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
status_t
|
||||||
|
elf_get_image_info_for_address(addr_t address, image_info* info)
|
||||||
|
{
|
||||||
|
MutexLocker _(sImageMutex);
|
||||||
|
struct elf_image_info* elfInfo = find_image_at_address(address);
|
||||||
|
if (elfInfo == NULL)
|
||||||
|
return B_ENTRY_NOT_FOUND;
|
||||||
|
|
||||||
|
info->id = elfInfo->id;
|
||||||
|
info->type = B_SYSTEM_IMAGE;
|
||||||
|
info->sequence = 0;
|
||||||
|
info->init_order = 0;
|
||||||
|
info->init_routine = NULL;
|
||||||
|
info->term_routine = NULL;
|
||||||
|
info->device = -1;
|
||||||
|
info->node = -1;
|
||||||
|
// TODO: We could actually fill device/node in.
|
||||||
|
strlcpy(info->name, elfInfo->name, sizeof(info->name));
|
||||||
|
info->text = (void*)elfInfo->text_region.start;
|
||||||
|
info->data = (void*)elfInfo->data_region.start;
|
||||||
|
info->text_size = elfInfo->text_region.size;
|
||||||
|
info->data_size = elfInfo->data_region.size;
|
||||||
|
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
elf_init(kernel_args *args)
|
elf_init(kernel_args *args)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user