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:
Axel Dörfler 2005-04-04 13:40:10 +00:00
parent 0c2ca2f1bf
commit b31c89d6e3
1 changed files with 6 additions and 0 deletions

View File

@ -55,6 +55,7 @@ static hash_table *sImagesHash;
static struct elf_image_info *sKernelImage = NULL;
static mutex sImageMutex;
static mutex sImageLoadMutex;
static bool sInitialized = false;
/** 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));
if (!sInitialized)
return B_ERROR;
mutex_lock(&sImageMutex);
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("symbols", &dump_symbols, "dump symbols for image");
add_debugger_command("image", &dump_image, "dump image info");
sInitialized = true;
return B_OK;
}