This is Unofficial EPICS BASE Doxygen Site
osdFindAddr.c
Go to the documentation of this file.
1 /*
2  * Copyright: Stanford University / SLAC National Laboratory.
3  *
4  * EPICS BASE is distributed subject to a Software License Agreement found
5  * in file LICENSE that is included with this distribution.
6  *
7  * Author: Till Straumann <strauman@slac.stanford.edu>, 2011, 2014
8  */
9 
10 /* Make sure dladdr() is visible */
11 #define _DARWIN_C_SOURCE
12 
13 #include <dlfcn.h>
14 
15 #include "epicsStackTrace.h"
16 #include "epicsStackTracePvt.h"
17 
18 /* Darwin's finds local symbols, too :-) */
19 
20 int epicsFindAddr(void *addr, epicsSymbol *sym_p)
21 {
22  Dl_info inf;
23 
24  if ( ! dladdr(addr, &inf) ) {
25  sym_p->f_nam = 0;
26  sym_p->s_nam = 0;
27  sym_p->s_val = 0;
28  } else {
29  sym_p->f_nam = inf.dli_fname;
30  sym_p->s_nam = inf.dli_sname;
31  sym_p->s_val = inf.dli_saddr;
32  }
33 
34  return 0;
35 }
36 
38 {
42 }
#define EPICS_STACKTRACE_LCL_SYMBOLS
int epicsFindAddrGetFeatures(void)
Definition: osdFindAddr.c:37
#define EPICS_STACKTRACE_GBL_SYMBOLS
const char * f_nam
#define EPICS_STACKTRACE_DYN_SYMBOLS
int epicsFindAddr(void *addr, epicsSymbol *sym_p)
Definition: osdFindAddr.c:20
const char * s_nam