aboutsummaryrefslogtreecommitdiff
path: root/gdb/sol-thread.c
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>1999-11-09 01:23:30 +0000
committerJason Molenda <jmolenda@apple.com>1999-11-09 01:23:30 +0000
commit11cf87416416e13eff634a70b4954fe6a3912720 (patch)
treea6dc7a21bb3d45b89c3f95e4b5862ec9d2fab83b /gdb/sol-thread.c
parent98007ce7b0dea06f0c04d833d39b5a9c9773a07a (diff)
downloadgdb-11cf87416416e13eff634a70b4954fe6a3912720.zip
gdb-11cf87416416e13eff634a70b4954fe6a3912720.tar.gz
gdb-11cf87416416e13eff634a70b4954fe6a3912720.tar.bz2
import gdb-1999-11-08 snapshot
Diffstat (limited to 'gdb/sol-thread.c')
-rw-r--r--gdb/sol-thread.c31
1 files changed, 25 insertions, 6 deletions
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index 68cde8a..218ab38 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -857,6 +857,13 @@ sol_thread_create_inferior (exec_file, allargs, env)
those variables don't show up until the library gets mapped and the symbol
table is read in. */
+/* This new_objfile event is now managed by a chained function pointer.
+ * It is the callee's responsability to call the next client on the chain.
+ */
+
+/* Saved pointer to previous owner of the new_objfile event. */
+static void (*target_new_objfile_chain) PARAMS ((struct objfile *));
+
void
sol_thread_new_objfile (objfile)
struct objfile *objfile;
@@ -866,13 +873,12 @@ sol_thread_new_objfile (objfile)
if (!objfile)
{
sol_thread_active = 0;
-
- return;
+ goto quit;
}
/* don't do anything if init failed to resolve the libthread_db library */
if (!procfs_suppress_run)
- return;
+ goto quit;
/* Now, initialize the thread debugging library. This needs to be done after
the shared libraries are located because it needs information from the
@@ -880,15 +886,25 @@ sol_thread_new_objfile (objfile)
val = p_td_init ();
if (val != TD_OK)
- error ("target_new_objfile: td_init: %s", td_err_string (val));
+ {
+ warning ("sol_thread_new_objfile: td_init: %s", td_err_string (val));
+ goto quit;
+ }
val = p_td_ta_new (&main_ph, &main_ta);
if (val == TD_NOLIBTHREAD)
- return;
+ goto quit;
else if (val != TD_OK)
- error ("target_new_objfile: td_ta_new: %s", td_err_string (val));
+ {
+ warning ("sol_thread_new_objfile: td_ta_new: %s", td_err_string (val));
+ goto quit;
+ }
sol_thread_active = 1;
+quit:
+ /* Call predecessor on chain, if any. */
+ if (target_new_objfile_chain)
+ target_new_objfile_chain (objfile);
}
/* Clean up after the inferior dies. */
@@ -1698,6 +1714,9 @@ _initialize_sol_thread ()
memcpy (&core_ops, &sol_core_ops, sizeof (struct target_ops));
add_target (&core_ops);
+ /* Hook into new_objfile notification. */
+ target_new_objfile_chain = target_new_objfile_hook;
+ target_new_objfile_hook = sol_thread_new_objfile;
return;
die: