summaryrefslogtreecommitdiff
path: root/linuxthreads_db/td_ta_new.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-11-05 02:26:16 +0000
committerUlrich Drepper <drepper@redhat.com>1999-11-05 02:26:16 +0000
commit9532eb67a4a92baab960d8d37bfa28048285dabb (patch)
tree179887a0e1239d9aebb41cffb1134f019712b56b /linuxthreads_db/td_ta_new.c
parentab86fbb1d2866df567219904982dac61751808e5 (diff)
downloadglibc-9532eb67a4a92baab960d8d37bfa28048285dabb.tar.gz
Update.
1999-11-03 Ulrich Drepper <drepper@cygnus.com> * Versions.def: Add version for libthread_db.
Diffstat (limited to 'linuxthreads_db/td_ta_new.c')
-rw-r--r--linuxthreads_db/td_ta_new.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/linuxthreads_db/td_ta_new.c b/linuxthreads_db/td_ta_new.c
index 65535f8d14..8d6ee9a7c5 100644
--- a/linuxthreads_db/td_ta_new.c
+++ b/linuxthreads_db/td_ta_new.c
@@ -25,10 +25,16 @@
#include "thread_dbP.h"
+/* Datatype for the list of known thread agents. Normally there will
+ be exactly one so we don't spend much though on making it fast. */
+struct agent_list *__td_agent_list;
+
+
td_err_e
td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta)
{
psaddr_t addr;
+ struct agent_list *elemp;
LOG (__FUNCTION__);
@@ -130,5 +136,19 @@ td_ta_new (struct ps_prochandle *ps, td_thragent_t **ta)
goto free_return;
}
+ /* Now add the new agent descriptor to the list. */
+ elemp = (struct agent_list *) malloc (sizeof (struct agent_list));
+ if (elemp == NULL)
+ {
+ /* Argh, now that everything else worked... */
+ free (*ta);
+ return TD_MALLOC;
+ }
+
+ /* We don't care for thread-safety here. */
+ elemp->ta = *ta;
+ elemp->next = __td_agent_list;
+ __td_agent_list = elemp;
+
return TD_OK;
}