]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - nptl_db/td_symbol_list.c
nptl: Move pthread_attr_setinheritsched implementation into libc.
[thirdparty/glibc.git] / nptl_db / td_symbol_list.c
index 252faa418d20c463cc6546c8f32565a03ffb5d06..fd9bbc487d3af072629ebd127630b1f647a729e4 100644 (file)
@@ -1,5 +1,5 @@
 /* Return list of symbols the library can request.
-   Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 2001-2019 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@redhat.com>, 2001.
 
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
 
 #include <assert.h>
-#include <gnu/lib-names.h>
 #include "thread_dbP.h"
 
-
 static const char *symbol_list_arr[] =
 {
-  [SYM_PTHREAD_THREADS_EVENTS] = "__nptl_threads_events",
-  [SYM_PTHREAD_LAST_EVENT] = "__nptl_last_event",
-  [SYM_PTHREAD_NTHREADS] = "__nptl_nthreads",
-  [SYM_PTHREAD_STACK_USED] = "stack_used",
-  [SYM_PTHREAD_STACK_USER] = "__stack_user",
-  [SYM_PTHREAD_KEYS] = "__pthread_keys",
-  [SYM_PTHREAD_KEYS_MAX] = "__pthread_pthread_keys_max",
-  [SYM_PTHREAD_SIZEOF_DESCR] = "__pthread_pthread_sizeof_descr",
-  [SYM_PTHREAD_CREATE_EVENT] = "__nptl_create_event",
-  [SYM_PTHREAD_DEATH_EVENT] = "__nptl_death_event",
-  [SYM_PTHREAD_VERSION] = "nptl_version",
+# define DB_LOOKUP_NAME(idx, name)             [idx] = STRINGIFY (name),
+# define DB_LOOKUP_NAME_TH_UNIQUE(idx, name)   [idx] = STRINGIFY (name),
+# include "db-symbols.h"
+# undef        DB_LOOKUP_NAME
+# undef        DB_LOOKUP_NAME_TH_UNIQUE
+
   [SYM_NUM_MESSAGES] = NULL
 };
 
@@ -47,9 +39,13 @@ td_symbol_list (void)
 }
 
 
-int
-td_lookup (struct ps_prochandle *ps, int idx, psaddr_t *sym_addr)
+ps_err_e
+td_mod_lookup (struct ps_prochandle *ps, const char *mod,
+              int idx, psaddr_t *sym_addr)
 {
+  ps_err_e result;
   assert (idx >= 0 && idx < SYM_NUM_MESSAGES);
-  return ps_pglobal_lookup (ps, LIBPTHREAD_SO, symbol_list_arr[idx], sym_addr);
+  result = ps_pglobal_lookup (ps, mod, symbol_list_arr[idx], sym_addr);
+
+  return result;
 }