summaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorNicholas Duffek <nsd@redhat.com>2000-07-19 21:03:06 +0000
committerNicholas Duffek <nsd@redhat.com>2000-07-19 21:03:06 +0000
commit710c87beb323f590e229b982a47383a1a7163147 (patch)
tree164432ee707f4fc4cf4420511ea6d816bd33c30e /gdb
parent7ab2c6c8fb1bf0cf275505c806e8564a9654566e (diff)
downloadgdb-710c87beb323f590e229b982a47383a1a7163147.tar.gz
* thread.c (free_thread): New function.
(init_thread_list): Always zero highest_thread_num. Call free_thread() instead of free(). (delete_thread): Move thread cleanup code to free_thread().
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/thread.c34
2 files changed, 26 insertions, 15 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 9624c4a9cea..c2cd85f375f 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2000-07-19 Nicholas Duffek <nsd@redhat.com>
+
+ * thread.c (free_thread): New function.
+ (init_thread_list): Always zero highest_thread_num. Call
+ free_thread() instead of free().
+ (delete_thread): Move thread cleanup code to free_thread().
+
2000-07-19 Elena Zannoni <ezannoni@kwikemart.cygnus.com>
Multiarch the sh target.
diff --git a/gdb/thread.c b/gdb/thread.c
index 38e74d45b15..00c6467f254 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -63,22 +63,38 @@ static void restore_current_thread (int);
static void switch_to_thread (int pid);
static void prune_threads (void);
+static void
+free_thread (struct thread_info *tp)
+{
+ /* NOTE: this will take care of any left-over step_resume breakpoints,
+ but not any user-specified thread-specific breakpoints. */
+ if (tp->step_resume_breakpoint)
+ delete_breakpoint (tp->step_resume_breakpoint);
+
+ /* FIXME: do I ever need to call the back-end to give it a
+ chance at this private data before deleting the thread? */
+ if (tp->private)
+ free (tp->private);
+
+ free (tp);
+}
+
void
init_thread_list ()
{
struct thread_info *tp, *tpnext;
+ highest_thread_num = 0;
if (!thread_list)
return;
for (tp = thread_list; tp; tp = tpnext)
{
tpnext = tp->next;
- free (tp);
+ free_thread (tp);
}
thread_list = NULL;
- highest_thread_num = 0;
}
/* add_thread now returns a pointer to the new thread_info,
@@ -134,19 +150,7 @@ delete_thread (pid)
else
thread_list = tp->next;
- /* NOTE: this will take care of any left-over step_resume breakpoints,
- but not any user-specified thread-specific breakpoints. */
- if (tp->step_resume_breakpoint)
- delete_breakpoint (tp->step_resume_breakpoint);
-
- /* FIXME: do I ever need to call the back-end to give it a
- chance at this private data before deleting the thread? */
- if (tp->private)
- free (tp->private);
-
- free (tp);
-
- return;
+ free_thread (tp);
}
static struct thread_info *