227 /*ARGSUSED*/
228 void
229 umem_printf_warn(void *ignored, const char *format, ...)
230 {
231 va_list va;
232
233 va_start(va, format);
234 umem_vprintf(format, va);
235 va_end(va);
236 }
237
238 /*
239 * print_sym tries to print out the symbol and offset of a pointer
240 */
241 int
242 print_sym(void *pointer)
243 {
244 int result;
245 Dl_info sym_info;
246
247 uintptr_t end = NULL;
248
249 Sym *ext_info = NULL;
250
251 result = dladdr1(pointer, &sym_info, (void **)&ext_info,
252 RTLD_DL_SYMENT);
253
254 if (result != 0) {
255 const char *endpath;
256
257 end = (uintptr_t)sym_info.dli_saddr + ext_info->st_size;
258
259 endpath = strrchr(sym_info.dli_fname, '/');
260 if (endpath)
261 endpath++;
262 else
263 endpath = sym_info.dli_fname;
264 umem_printf("%s'", endpath);
265 }
266
267 if (result == 0 || (uintptr_t)pointer > end) {
|
227 /*ARGSUSED*/
228 void
229 umem_printf_warn(void *ignored, const char *format, ...)
230 {
231 va_list va;
232
233 va_start(va, format);
234 umem_vprintf(format, va);
235 va_end(va);
236 }
237
238 /*
239 * print_sym tries to print out the symbol and offset of a pointer
240 */
241 int
242 print_sym(void *pointer)
243 {
244 int result;
245 Dl_info sym_info;
246
247 uintptr_t end = (uintptr_t)NULL;
248
249 Sym *ext_info = NULL;
250
251 result = dladdr1(pointer, &sym_info, (void **)&ext_info,
252 RTLD_DL_SYMENT);
253
254 if (result != 0) {
255 const char *endpath;
256
257 end = (uintptr_t)sym_info.dli_saddr + ext_info->st_size;
258
259 endpath = strrchr(sym_info.dli_fname, '/');
260 if (endpath)
261 endpath++;
262 else
263 endpath = sym_info.dli_fname;
264 umem_printf("%s'", endpath);
265 }
266
267 if (result == 0 || (uintptr_t)pointer > end) {
|