summaryrefslogtreecommitdiff
path: root/linuxthreads_db/td_ta_new.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-03-20 21:05:29 +0000
committerUlrich Drepper <drepper@redhat.com>2001-03-20 21:05:29 +0000
commit481b550f585164c7faef0075aa10e34b57959e1e (patch)
tree99a92c9382037502b65acb4e1316be0c441bb03b /linuxthreads_db/td_ta_new.c
parentf1e4a4a403f740c153acfc0cd96ecc5aa542e341 (diff)
Update.
* Makefile: Define -D_RPC_THREAD_SAFE_ for cancel.c.
Diffstat (limited to 'linuxthreads_db/td_ta_new.c')
-rw-r--r--linuxthreads_db/td_ta_new.c42
1 files changed, 10 insertions, 32 deletions
diff --git a/linuxthreads_db/td_ta_new.c b/linuxthreads_db/td_ta_new.c
index 8d6ee9a7c5..08c1822ae3 100644
--- a/linuxthreads_db/td_ta_new.c
+++ b/linuxthreads_db/td_ta_new.c
@@ -1,5 +1,5 @@
/* Attach to target process.
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2001 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1999.
@@ -20,7 +20,6 @@
#include <stddef.h>
#include <stdlib.h>
-#include <gnu/lib-names.h>
#include "thread_dbP.h"
@@ -41,8 +40,7 @@ td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta)
/* Get the global event mask. This is one of the variables which
are new in the thread library to enable debugging. If it is
not available we cannot debug. */
- if (ps_pglobal_lookup (ps, LIBPTHREAD_SO,
- "__pthread_threads_events", &addr) != PS_OK)
+ if (td_lookup (ps, PTHREAD_THREADS_EVENTS, &addr) != PS_OK)
return TD_NOLIBTHREAD;
/* Fill in the appropriate information. */
@@ -59,9 +57,7 @@ td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta)
/* Get the pointer to the variable pointing to the thread descriptor
with the last event. */
- if (ps_pglobal_lookup (ps, LIBPTHREAD_SO,
- "__pthread_last_event",
- &(*ta)->pthread_last_event) != PS_OK)
+ if (td_lookup (ps, PTHREAD_LAST_EVENT, &(*ta)->pthread_last_event) != PS_OK)
{
free_return:
free (*ta);
@@ -70,21 +66,18 @@ td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta)
/* Get the pointer to the variable containing the number of active
threads. */
- if (ps_pglobal_lookup (ps, LIBPTHREAD_SO,
- "__pthread_handles_num",
- &(*ta)->pthread_handles_num) != PS_OK)
+ if (td_lookup (ps, PTHREAD_HANDLES_NUM, &(*ta)->pthread_handles_num)
+ != PS_OK)
goto free_return;
/* See whether the library contains the necessary symbols. */
- if (ps_pglobal_lookup (ps, LIBPTHREAD_SO, "__pthread_handles",
- &addr) != PS_OK)
+ if (td_lookup (ps, PTHREAD_HANDLES, &addr) != PS_OK)
goto free_return;
(*ta)->handles = (struct pthread_handle_struct *) addr;
- if (ps_pglobal_lookup (ps, LIBPTHREAD_SO, "pthread_keys",
- &addr) != PS_OK)
+ if (td_lookup (ps, PTHREAD_KEYS, &addr) != PS_OK)
goto free_return;
/* Cast to the right type. */
@@ -93,8 +86,7 @@ td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta)
/* Find out about the maximum number of threads. Old implementations
don't provide this information. In this case we assume that the
debug library is compiled with the same values. */
- if (ps_pglobal_lookup (ps, LIBPTHREAD_SO,
- "__linuxthreads_pthread_threads_max", &addr) != PS_OK)
+ if (td_lookup (ps, LINUXTHREADS_PTHREAD_THREADS_MAX, &addr) != PS_OK)
(*ta)->pthread_threads_max = PTHREAD_THREADS_MAX;
else
{
@@ -104,8 +96,7 @@ td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta)
}
/* Similar for the maximum number of thread local data keys. */
- if (ps_pglobal_lookup (ps, LIBPTHREAD_SO,
- "__linuxthreads_pthread_keys_max", &addr) != PS_OK)
+ if (td_lookup (ps, LINUXTHREADS_PTHREAD_KEYS_MAX, &addr) != PS_OK)
(*ta)->pthread_keys_max = PTHREAD_KEYS_MAX;
else
{
@@ -115,9 +106,7 @@ td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta)
}
/* And for the size of the second level arrays for the keys. */
- if (ps_pglobal_lookup (ps, LIBPTHREAD_SO,
- "__linuxthreads_pthread_sizeof_descr", &addr)
- != PS_OK)
+ if (td_lookup (ps, LINUXTHREADS_PTHREAD_SIZEOF_DESCR, &addr) != PS_OK)
(*ta)->sizeof_descr = sizeof (struct _pthread_descr_struct);
else
{
@@ -125,17 +114,6 @@ td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta)
goto free_return;
}
- /* Similar for the maximum number of thread local data keys. */
- if (ps_pglobal_lookup (ps, LIBPTHREAD_SO,
- "__linuxthreads_pthread_keys_max", &addr) != PS_OK)
- (*ta)->pthread_keys_max = PTHREAD_KEYS_MAX;
- else
- {
- if (ps_pdread (ps, addr, &(*ta)->pthread_keys_max, sizeof (int))
- != PS_OK)
- goto free_return;
- }
-
/* Now add the new agent descriptor to the list. */
elemp = (struct agent_list *) malloc (sizeof (struct agent_list));
if (elemp == NULL)