rem: TRACE(("  %p looking at %s, type = %d, bind = %d, addr = %p\n",sym,SYMNAME(image, sym),ELF32_ST_TYPE(sym->st_info),ELF32_ST_BIND(sym->st_info),(void *)sym->st_value)); TRACE(("  symbol: %lx (%x + %lx)\n", sym->st_value + image->regions[0].delta, sym->st_value, image->regions[0].delta));
add: TRACE((" searching debug symbols...\n"));
context: elf_lookup_symbol_address(addr address, addr *baseAddress, char *text, size_t length){	struct hash_iterator iterator;	struct elf_image_info *image;	struct Elf32_Sym *sym;	struct elf_image_info *found_image;	struct Elf32_Sym *found_sym;	long found_delta;	uint32 i;	int j,rv;	TRACE(("looking up %p\n",(void *)address));	mutex_lock(&sImageMutex);	hash_open(sImagesHash, &iterator);	found_sym = 0;	found_image = 0;	found_delta = 0x7fffffff;	while ((image = hash_next(sImagesHash, &iterator)) != NULL) {		TRACE((" image %p, base = %p, size = %p\n", image, (void *)image->regions[0].start, (void *)image->regions[0].size));		if ((address < image->regions[0].start) || (address >= (image->regions[0].start + image->regions[0].size)))			continue;		TRACE((" searching...\n"));		found_image = image;		for (i = 0; i < HASHTABSIZE(image); i++) {			for (j = HASHBUCKETS(image)[i]; j != STN_UNDEF; j = HASHCHAINS(image)[j]) {				long d;				sym = &image->syms[j];				TRACE(("  %p looking at %s, type = %d, bind = %d, addr = %p\n",sym,SYMNAME(image, sym),ELF32_ST_TYPE(sym->st_info),ELF32_ST_BIND(sym->st_info),(void *)sym->st_value));				TRACE(("  symbol: %lx (%x + %lx)\n", sym->st_value + image->regions[0].delta, sym->st_value, image->regions[0].delta));				if ((ELF32_ST_TYPE(sym->st_info) != STT_FUNC) || (ELF32_ST_BIND(sym->st_info) != STB_GLOBAL))					continue;				d = (long)address - (long)(sym->st_value + image->regions[0].delta);				if ((d >= 0) && (d < found_delta)) {					found_delta = d;					found_sym = sym;				}			}		}		break;	}	if (found_sym != 0) {		TRACE(("symbol at %p, in image %p, name = %s\n", found_sym, found_image, found_image->name));		TRACE(("name index %d, '%s'\n", found_sym->st_name, SYMNAME(found_image, found_sym)));		TRACE(("addr = %#lx, offset = %#lx\n",(found_sym->st_value + found_image->regions[0].delta),found_delta));		strlcpy(text, SYMNAME(found_image, found_sym), length);				if (baseAddress)			*baseAddress = found_sym->st_value + found_image->regions[0].delta;		rv = B_OK;	} else {		TRACE(("symbol not found!\n"));		strlcpy(text, "symbol not found", length);		rv = B_ENTRY_NOT_FOUND;	}	hash_close(sImagesHash, &iterator, false);	mutex_unlock(&sImageMutex);	return rv;}