+ *getmodules_callback_arg->sym_addr = (psaddr_t) sym.st_value;
+ getmodules_callback_arg->retval = PS_OK;
+
+ return DWARF_CB_OK;
+}
+
+/* Look up the named symbol in the named DSO in the symbol tables
+ associated with the process being debugged, filling in *SYM_ADDR
+ with the corresponding run-time address. */
+ps_err_e ps_pglobal_lookup (struct ps_prochandle *proc_handle,
+ const char *object_name, const char *sym_name,
+ psaddr_t *sym_addr)
+{
+ Dwfl *dwfl = get_dwfl (proc_handle);
+ struct getmodules_callback_arg getmodules_callback_arg;
+ ptrdiff_t err_ptrdiff;
+
+ /* FIXME: `object_name' ignored due to missing unresolving of shared
+ libraries symbolic links. */
+ getmodules_callback_arg.sym_name = sym_name;
+ getmodules_callback_arg.sym_addr = sym_addr;
+ getmodules_callback_arg.retval = PS_NOSYM;
+ err_ptrdiff = dwfl_getmodules (dwfl, getmodules_callback,
+ &getmodules_callback_arg, 0);
+ assert (err_ptrdiff == 0);
+ return getmodules_callback_arg.retval;