rem: add_debugger_command("ls", &print_address_info, "lookup symbol for a particular address");
add: add_debugger_command("ls", &dump_address_info, "lookup symbol for a particular address"); add_debugger_command("symbols", &dump_symbols, "dump symbols for image");
context: elf_init(kernel_args *ka){	area_info areaInfo;	struct preloaded_image *image;	image_init();	mutex_init(&sImageMutex, "kimages_lock");	mutex_init(&sImageLoadMutex, "kimages_load_lock");	sImagesHash = hash_init(IMAGE_HASH_SIZE, 0, image_compare, image_hash);	if (sImagesHash == NULL)		return B_NO_MEMORY;	// Build a image structure for the kernel, which has already been loaded.	// The VM has created areas for it under a known name already	sKernelImage = create_image_struct();	sKernelImage->name = strdup("kernel");	// text segment	sKernelImage->regions[0].id = find_area("kernel_ro");	if (sKernelImage->regions[0].id < 0)		panic("elf_init: could not look up kernel text segment region\n");	get_area_info(sKernelImage->regions[0].id, &areaInfo);	sKernelImage->regions[0].start = (addr)areaInfo.address;	sKernelImage->regions[0].size = areaInfo.size;	// data segment	sKernelImage->regions[1].id = find_area("kernel_rw");	if (sKernelImage->regions[1].id < 0)		panic("elf_init: could not look up kernel data segment region\n");	get_area_info(sKernelImage->regions[1].id, &areaInfo);	sKernelImage->regions[1].start = (addr)areaInfo.address;	sKernelImage->regions[1].size = areaInfo.size;	// we know where the dynamic section is	sKernelImage->dynamic_ptr = (addr)ka->kernel_dynamic_section_addr.start;	// parse the dynamic section	if (elf_parse_dynamic_section(sKernelImage) < 0)		dprintf("elf_init: WARNING elf_parse_dynamic_section couldn't find dynamic section.\n");	// insert it first in the list of kernel images loaded	register_elf_image(sKernelImage);	// Build image structures for all preloaded images.	// Again, the VM has already created areas for them.	for (image = ka->preloaded_images; image != NULL; image = image->next) {		insert_preloaded_image(image);	}	add_debugger_command("ls", &print_address_info, "lookup symbol for a particular address");	add_debugger_command("image", &dump_image, "dump image info");	return B_OK;}