diff options
author | Pedro Alves <palves@redhat.com> | 2008-08-16 22:12:18 +0000 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2008-08-16 22:12:18 +0000 |
commit | aa76d38d1d90e7958dba24494b15ec9798f50229 (patch) | |
tree | 3cd16b4ff66b0810d01a9d7ff02880c8aef4e28c /gdb/target.c | |
parent | 311a4e6b7b004617841f2a6c657e76dddd7d2249 (diff) | |
download | gdb-aa76d38d1d90e7958dba24494b15ec9798f50229.zip gdb-aa76d38d1d90e7958dba24494b15ec9798f50229.tar.gz gdb-aa76d38d1d90e7958dba24494b15ec9798f50229.tar.bz2 |
* target.h (pop_all_targets): Declare.
* target.c (pop_all_targets): New.
* top.c (quit_target): Pop all targets instead of just closing the
current.
Diffstat (limited to 'gdb/target.c')
-rw-r--r-- | gdb/target.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/target.c b/gdb/target.c index 6cda095..384fa20 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -821,6 +821,24 @@ pop_target (void) internal_error (__FILE__, __LINE__, _("failed internal consistency check")); } +void +pop_all_targets (int quitting) +{ + while ((int) (current_target.to_stratum) > (int) dummy_stratum) + { + target_close (¤t_target, quitting); + if (!unpush_target (target_stack)) + { + fprintf_unfiltered (gdb_stderr, + "pop_all_targets couldn't find target %s\n", + current_target.to_shortname); + internal_error (__FILE__, __LINE__, + _("failed internal consistency check")); + break; + } + } +} + /* Using the objfile specified in OBJFILE, find the address for the current thread's thread-local storage with offset OFFSET. */ CORE_ADDR |