[4/7] Eliminate catch(...) in target_wait
Checks
Context |
Check |
Description |
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_build--master-arm |
success
|
Build passed
|
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 |
success
|
Test passed
|
Commit Message
Remove duplicate code in target_wait using SCOPE_EXIT.
Tested on aarch64-linux.
---
gdb/target.c | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
Comments
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> Remove duplicate code in target_wait using SCOPE_EXIT.
Tom> Tested on aarch64-linux.
Ok.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
@@ -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. */