elf_lookup_symbol_address() can now safely be called before elf_init() has been called.
This is helpful in getting a stack crawl during early startup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12226 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -55,6 +55,7 @@ static hash_table *sImagesHash;
|
|||||||
static struct elf_image_info *sKernelImage = NULL;
|
static struct elf_image_info *sKernelImage = NULL;
|
||||||
static mutex sImageMutex;
|
static mutex sImageMutex;
|
||||||
static mutex sImageLoadMutex;
|
static mutex sImageLoadMutex;
|
||||||
|
static bool sInitialized = false;
|
||||||
|
|
||||||
|
|
||||||
/** calculates hash for an image using its ID */
|
/** calculates hash for an image using its ID */
|
||||||
@@ -893,6 +894,9 @@ elf_lookup_symbol_address(addr_t address, addr_t *_baseAddress, const char **_sy
|
|||||||
|
|
||||||
TRACE(("looking up %p\n", (void *)address));
|
TRACE(("looking up %p\n", (void *)address));
|
||||||
|
|
||||||
|
if (!sInitialized)
|
||||||
|
return B_ERROR;
|
||||||
|
|
||||||
mutex_lock(&sImageMutex);
|
mutex_lock(&sImageMutex);
|
||||||
|
|
||||||
image = find_image_at_address(address);
|
image = find_image_at_address(address);
|
||||||
@@ -1457,6 +1461,8 @@ elf_init(kernel_args *ka)
|
|||||||
add_debugger_command("ls", &dump_address_info, "lookup symbol for a particular address");
|
add_debugger_command("ls", &dump_address_info, "lookup symbol for a particular address");
|
||||||
add_debugger_command("symbols", &dump_symbols, "dump symbols for image");
|
add_debugger_command("symbols", &dump_symbols, "dump symbols for image");
|
||||||
add_debugger_command("image", &dump_image, "dump image info");
|
add_debugger_command("image", &dump_image, "dump image info");
|
||||||
|
|
||||||
|
sInitialized = true;
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user