aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorTom de Vries <tdevries@suse.de>2024-09-24 13:55:50 +0200
committerTom de Vries <tdevries@suse.de>2024-09-24 13:55:50 +0200
commitf3f21aa9f90ccbcf73779b167aaee0fb6bbd3f4d (patch)
tree0000eb4ad1f5376435853c82094baf8d306997ca /gdb/target.c
parent7fd46e6b2ac5a30ecb33b4b290d824247cb68a20 (diff)
downloadgdb-f3f21aa9f90ccbcf73779b167aaee0fb6bbd3f4d.zip
gdb-f3f21aa9f90ccbcf73779b167aaee0fb6bbd3f4d.tar.gz
gdb-f3f21aa9f90ccbcf73779b167aaee0fb6bbd3f4d.tar.bz2
[gdb] Eliminate catch(...) in target_wait
Remove duplicate code in target_wait using SCOPE_EXIT. Tested on aarch64-linux. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 47f09f5..962996f 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -2575,18 +2575,12 @@ target_wait (ptid_t ptid, struct target_waitstatus *status,
if (!target_can_async_p (target))
gdb_assert ((options & TARGET_WNOHANG) == 0);
- try
- {
- gdb::observers::target_pre_wait.notify (ptid);
- ptid_t event_ptid = target->wait (ptid, status, options);
- gdb::observers::target_post_wait.notify (event_ptid);
- return event_ptid;
- }
- catch (...)
- {
- gdb::observers::target_post_wait.notify (null_ptid);
- throw;
- }
+ ptid_t event_ptid = null_ptid;
+ SCOPE_EXIT { gdb::observers::target_post_wait.notify (event_ptid); };
+ gdb::observers::target_pre_wait.notify (ptid);
+ event_ptid = target->wait (ptid, status, options);
+
+ return event_ptid;
}
/* See target.h. */