projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Change inferior thread list to be a thread map
[deliverable/binutils-gdb.git]
/
gdb
/
inferior.c
diff --git
a/gdb/inferior.c
b/gdb/inferior.c
index e7b49376e93dece2624e6ad1a363afce030da0f2..d268d031e2ca60dfd6276cebae747fd8d7296a10 100644
(file)
--- a/
gdb/inferior.c
+++ b/
gdb/inferior.c
@@
-29,7
+29,7
@@
#include "observable.h"
#include "gdbcore.h"
#include "symfile.h"
#include "observable.h"
#include "gdbcore.h"
#include "symfile.h"
-#include "
common
/environ.h"
+#include "
gdbsupport
/environ.h"
#include "cli/cli-utils.h"
#include "continuations.h"
#include "arch-utils.h"
#include "cli/cli-utils.h"
#include "continuations.h"
#include "arch-utils.h"
@@
-46,7
+46,7
@@
struct inferior *inferior_list = NULL;
static int highest_inferior_num;
/* See inferior.h. */
static int highest_inferior_num;
/* See inferior.h. */
-
int print_inferior_events = 1
;
+
bool print_inferior_events = true
;
/* The Current Inferior. This is a strong reference. I.e., whenever
an inferior is the current inferior, its refcount is
/* The Current Inferior. This is a strong reference. I.e., whenever
an inferior is the current inferior, its refcount is
@@
-148,8
+148,8
@@
delete_inferior (struct inferior *todel)
if (!inf)
return;
if (!inf)
return;
- for (thread_info *tp : inf->threads
_safe
())
- delete_thread_silent (tp);
+ for (thread_info *tp : inf->threads ())
+ delete_thread_silent
_noremove
(tp);
if (infprev)
infprev->next = inf->next;
if (infprev)
infprev->next = inf->next;
@@
-180,14
+180,16
@@
exit_inferior_1 (struct inferior *inftoex, int silent)
if (!inf)
return;
if (!inf)
return;
- for (thread_info *tp : inf->threads
_safe
())
+ for (thread_info *tp : inf->threads ())
{
if (silent)
{
if (silent)
- delete_thread_silent (tp);
+ delete_thread_silent
_noremove
(tp);
else
else
- delete_thread (tp);
+ delete_thread
_noremove
(tp);
}
}
+ inf->thread_map.clear ();
+
gdb::observers::inferior_exit.notify (inf);
inf->pid = 0;
gdb::observers::inferior_exit.notify (inf);
inf->pid = 0;
@@
-208,6
+210,10
@@
exit_inferior_1 (struct inferior *inftoex, int silent)
inf->pending_detach = 0;
/* Reset it. */
inf->control = inferior_control_state (NO_STOP_QUIETLY);
inf->pending_detach = 0;
/* Reset it. */
inf->control = inferior_control_state (NO_STOP_QUIETLY);
+
+ /* Clear the register cache and the frame cache. */
+ registers_changed ();
+ reinit_frame_cache ();
}
void
}
void
@@
-216,14
+222,6
@@
exit_inferior (inferior *inf)
exit_inferior_1 (inf, 0);
}
exit_inferior_1 (inf, 0);
}
-void
-exit_inferior_silent (int pid)
-{
- struct inferior *inf = find_inferior_pid (pid);
-
- exit_inferior_1 (inf, 1);
-}
-
void
exit_inferior_silent (inferior *inf)
{
void
exit_inferior_silent (inferior *inf)
{
@@
-374,24
+372,22
@@
have_live_inferiors (void)
void
prune_inferiors (void)
{
void
prune_inferiors (void)
{
-
struct inferior *ss, **ss_link
;
+
inferior *ss
;
ss = inferior_list;
ss = inferior_list;
- ss_link = &inferior_list;
while (ss)
{
if (!ss->deletable ()
|| !ss->removable
|| ss->pid != 0)
{
while (ss)
{
if (!ss->deletable ()
|| !ss->removable
|| ss->pid != 0)
{
- ss_link = &ss->next;
- ss = *ss_link;
+ ss = ss->next;
continue;
}
continue;
}
-
*ss_link
= ss->next;
+
inferior *ss_next
= ss->next;
delete_inferior (ss);
delete_inferior (ss);
- ss =
*ss_link
;
+ ss =
ss_next
;
}
}
}
}
@@
-477,7
+473,7
@@
print_inferior (struct ui_out *uiout, const char *requested_inferiors)
else
uiout->field_skip ("current");
else
uiout->field_skip ("current");
- uiout->field_
int
("number", inf->num);
+ uiout->field_
signed
("number", inf->num);
uiout->field_string ("target-id", inferior_pid_to_str (inf->pid));
uiout->field_string ("target-id", inferior_pid_to_str (inf->pid));
@@
-492,12
+488,12
@@
print_inferior (struct ui_out *uiout, const char *requested_inferiors)
if (inf->vfork_parent)
{
uiout->text (_("\n\tis vfork child of inferior "));
if (inf->vfork_parent)
{
uiout->text (_("\n\tis vfork child of inferior "));
- uiout->field_
int
("vfork-parent", inf->vfork_parent->num);
+ uiout->field_
signed
("vfork-parent", inf->vfork_parent->num);
}
if (inf->vfork_child)
{
uiout->text (_("\n\tis vfork parent of inferior "));
}
if (inf->vfork_child)
{
uiout->text (_("\n\tis vfork parent of inferior "));
- uiout->field_
int
("vfork-child", inf->vfork_child->num);
+ uiout->field_
signed
("vfork-child", inf->vfork_child->num);
}
uiout->text ("\n");
}
uiout->text ("\n");
@@
-596,7
+592,7
@@
inferior_command (const char *args, int from_tty)
{
if (inf != current_inferior ())
{
{
if (inf != current_inferior ())
{
- thread_info *tp =
any
_thread_of_inferior (inf);
+ thread_info *tp =
first
_thread_of_inferior (inf);
if (tp == NULL)
error (_("Inferior has no threads."));
if (tp == NULL)
error (_("Inferior has no threads."));
This page took
0.038866 seconds
and
4
git commands to generate.