This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v2 20/22] Replace throw_exception with throw in some cases
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Wed, 27 Feb 2019 13:18:47 -0700
- Subject: [PATCH v2 20/22] Replace throw_exception with throw in some cases
- References: <20190227201849.32210-1-tom@tromey.com>
This replaces throw_exception with "throw;" when possible. This was
written by script. The rule that is followed is that uses of the
form:
catch (... &name)
{
...
throw_exception (name);
}
... can be rewritten. It's possible (though IMO unlikely) that such a
case could be wrong, if the exception object is rewritten in the body
of the catch. (One option here might be to catch a const & instead.)
gdb/ChangeLog
2019-02-27 Tom Tromey <tom@tromey.com>
* valops.c (value_rtti_indirect_type): Replace throw_exception
with throw.
* tracefile-tfile.c (tfile_target_open): Replace throw_exception
with throw.
* thread.c (thr_try_catch_cmd): Replace throw_exception with
throw.
* target.c (target_translate_tls_address): Replace throw_exception
with throw.
* stack.c (frame_apply_command_count): Replace throw_exception
with throw.
* solib-spu.c (append_ocl_sos): Replace throw_exception with
throw.
* s390-tdep.c (s390_frame_unwind_cache): Replace throw_exception
with throw.
* rs6000-tdep.c (rs6000_frame_cache)
(rs6000_epilogue_frame_cache): Replace throw_exception with throw.
* remote.c: Replace throw_exception with throw.
* record-full.c (record_full_message, record_full_wait_1)
(record_full_restore): Replace throw_exception with throw.
* record-btrace.c:
(get_thread_current_frame_id, record_btrace_start_replaying)
(cmd_record_btrace_bts_start, cmd_record_btrace_pt_start)
(cmd_record_btrace_start): Replace throw_exception with throw.
* parse.c (parse_exp_in_context_1): Replace throw_exception with
throw.
* linux-nat.c (detach_one_lwp, linux_resume_one_lwp)
(resume_stopped_resumed_lwps): Replace throw_exception with throw.
* linespec.c:
(find_linespec_symbols): Replace throw_exception with throw.
* infrun.c (displaced_step_prepare, resume): Replace
throw_exception with throw.
* infcmd.c (post_create_inferior): Replace throw_exception with
throw.
* inf-loop.c (inferior_event_handler): Replace throw_exception
with throw.
* i386-tdep.c (i386_frame_cache, i386_epilogue_frame_cache)
(i386_sigtramp_frame_cache): Replace throw_exception with throw.
* frame.c (frame_unwind_pc, get_prev_frame_if_no_cycle)
(get_prev_frame_always, get_frame_pc_if_available)
(get_frame_address_in_block_if_available, get_frame_language):
Replace throw_exception with throw.
* frame-unwind.c (frame_unwind_try_unwinder): Replace
throw_exception with throw.
* eval.c (fetch_subexp_value, evaluate_var_value)
(evaluate_funcall, evaluate_subexp_standard): Replace
throw_exception with throw.
* dwarf2loc.c (call_site_find_chain)
(dwarf2_evaluate_loc_desc_full, dwarf2_locexpr_baton_eval):
Replace throw_exception with throw.
* dwarf2-frame.c (dwarf2_frame_cache): Replace throw_exception
with throw.
* darwin-nat.c (darwin_attach_pid): Replace throw_exception with
throw.
* cp-abi.c (baseclass_offset): Replace throw_exception with throw.
* completer.c (complete_line_internal): Replace throw_exception
with throw.
* compile/compile-object-run.c (compile_object_run): Replace
throw_exception with throw.
* cli/cli-script.c (process_next_line): Replace throw_exception
with throw.
* btrace.c (btrace_compute_ftrace_pt, btrace_compute_ftrace)
(btrace_enable, btrace_maint_update_pt_packets): Replace
throw_exception with throw.
* breakpoint.c (create_breakpoint, save_breakpoints): Replace
throw_exception with throw.
* break-catch-throw.c (re_set_exception_catchpoint): Replace
throw_exception with throw.
* amd64-tdep.c (amd64_frame_cache, amd64_sigtramp_frame_cache)
(amd64_epilogue_frame_cache): Replace throw_exception with throw.
* aarch64-tdep.c (aarch64_make_prologue_cache)
(aarch64_make_stub_cache): Replace throw_exception with throw.
gdb/gdbserver/ChangeLog
2019-02-27 Tom Tromey <tom@tromey.com>
* linux-low.c (linux_detach_one_lwp): Replace throw_exception with
throw.
(linux_resume_one_lwp): Likewise.
---
gdb/ChangeLog | 74 ++++++++++++++++++++++++++++++++
gdb/aarch64-tdep.c | 4 +-
gdb/amd64-tdep.c | 6 +--
gdb/break-catch-throw.c | 2 +-
gdb/breakpoint.c | 8 ++--
gdb/btrace.c | 8 ++--
gdb/cli/cli-script.c | 2 +-
gdb/compile/compile-object-run.c | 2 +-
gdb/completer.c | 2 +-
gdb/cp-abi.c | 2 +-
gdb/darwin-nat.c | 2 +-
gdb/dwarf2-frame.c | 2 +-
gdb/dwarf2loc.c | 6 +--
gdb/eval.c | 8 ++--
gdb/frame-unwind.c | 2 +-
gdb/frame.c | 12 +++---
gdb/gdbserver/ChangeLog | 6 +++
gdb/gdbserver/linux-low.c | 4 +-
gdb/i386-tdep.c | 6 +--
gdb/inf-loop.c | 2 +-
gdb/infcmd.c | 2 +-
gdb/infrun.c | 4 +-
gdb/linespec.c | 4 +-
gdb/linux-nat.c | 6 +--
gdb/parse.c | 2 +-
gdb/record-btrace.c | 14 +++---
gdb/record-full.c | 6 +--
gdb/remote.c | 6 +--
gdb/rs6000-tdep.c | 4 +-
gdb/s390-tdep.c | 2 +-
gdb/solib-spu.c | 2 +-
gdb/stack.c | 2 +-
gdb/target.c | 2 +-
gdb/thread.c | 2 +-
gdb/tracefile-tfile.c | 2 +-
gdb/valops.c | 2 +-
36 files changed, 151 insertions(+), 71 deletions(-)
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index bee1e7ed93b..bd7252d5566 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -783,7 +783,7 @@ aarch64_make_prologue_cache (struct frame_info *this_frame, void **this_cache)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
return cache;
@@ -909,7 +909,7 @@ aarch64_make_stub_cache (struct frame_info *this_frame, void **this_cache)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
return cache;
diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index cff1d2419b8..1101d30d39c 100644
--- a/gdb/amd64-tdep.c
+++ b/gdb/amd64-tdep.c
@@ -2588,7 +2588,7 @@ amd64_frame_cache (struct frame_info *this_frame, void **this_cache)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
return cache;
@@ -2715,7 +2715,7 @@ amd64_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
*this_cache = cache;
@@ -2895,7 +2895,7 @@ amd64_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
return cache;
diff --git a/gdb/break-catch-throw.c b/gdb/break-catch-throw.c
index ca1d7c71bd7..a1d67afffe3 100644
--- a/gdb/break-catch-throw.c
+++ b/gdb/break-catch-throw.c
@@ -214,7 +214,7 @@ re_set_exception_catchpoint (struct breakpoint *self)
/* NOT_FOUND_ERROR just means the breakpoint will be
pending, so let it through. */
if (ex.error != NOT_FOUND_ERROR)
- throw_exception (ex);
+ throw;
}
}
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index 35dbc867f7a..2013064e96c 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -9243,7 +9243,7 @@ create_breakpoint (struct gdbarch *gdbarch,
error. */
if (pending_break_support == AUTO_BOOLEAN_FALSE)
- throw_exception (e);
+ throw;
exception_print (gdb_stderr, e);
@@ -9261,7 +9261,7 @@ create_breakpoint (struct gdbarch *gdbarch,
pending = 1;
}
else
- throw_exception (e);
+ throw;
}
if (!pending && canonical.lsals.empty ())
@@ -13625,7 +13625,7 @@ location_to_sals (struct breakpoint *b, struct event_location *location,
happens only when a binary has changed, I don't know
which approach is better. */
b->enable_state = bp_disabled;
- throw_exception (e);
+ throw;
}
}
@@ -15024,7 +15024,7 @@ save_breakpoints (const char *filename, int from_tty,
catch (const struct gdb_exception &ex)
{
current_uiout->redirect (NULL);
- throw_exception (ex);
+ throw;
}
current_uiout->redirect (NULL);
diff --git a/gdb/btrace.c b/gdb/btrace.c
index 26a6ede4dd5..3c4d3501902 100644
--- a/gdb/btrace.c
+++ b/gdb/btrace.c
@@ -1484,7 +1484,7 @@ btrace_compute_ftrace_pt (struct thread_info *tp,
btrace_finalize_ftrace_pt (decoder, tp, level);
- throw_exception (error);
+ throw;
}
btrace_finalize_ftrace_pt (decoder, tp, level);
@@ -1560,7 +1560,7 @@ btrace_compute_ftrace (struct thread_info *tp, struct btrace_data *btrace,
{
btrace_finalize_ftrace (tp, gaps);
- throw_exception (error);
+ throw;
}
btrace_finalize_ftrace (tp, gaps);
@@ -1631,7 +1631,7 @@ btrace_enable (struct thread_info *tp, const struct btrace_config *conf)
{
btrace_disable (tp);
- throw_exception (exception);
+ throw;
}
}
@@ -3065,7 +3065,7 @@ btrace_maint_update_pt_packets (struct btrace_thread_info *btinfo)
pt_pkt_free_decoder (decoder);
if (except.reason < 0)
- throw_exception (except);
+ throw;
}
pt_pkt_free_decoder (decoder);
diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c
index 3730827d9b4..600ed84f078 100644
--- a/gdb/cli/cli-script.c
+++ b/gdb/cli/cli-script.c
@@ -1057,7 +1057,7 @@ process_next_line (const char *p, struct command_line **command,
catch (const struct gdb_exception &ex)
{
free_command_lines (command);
- throw_exception (ex);
+ throw;
}
}
diff --git a/gdb/compile/compile-object-run.c b/gdb/compile/compile-object-run.c
index ea24eee73b8..6462d286f88 100644
--- a/gdb/compile/compile-object-run.c
+++ b/gdb/compile/compile-object-run.c
@@ -183,7 +183,7 @@ compile_object_run (struct compile_module *module)
gdb_assert (!(dtor_found && executed));
if (!dtor_found && !executed)
do_module_cleanup (data, 0);
- throw_exception (ex);
+ throw;
}
dtor_found = find_dummy_frame_dtor (do_module_cleanup, data);
diff --git a/gdb/completer.c b/gdb/completer.c
index 748198500c1..c2ae2aac6ed 100644
--- a/gdb/completer.c
+++ b/gdb/completer.c
@@ -1451,7 +1451,7 @@ complete_line_internal (completion_tracker &tracker,
catch (const struct gdb_exception_error &except)
{
if (except.error != MAX_COMPLETIONS_REACHED_ERROR)
- throw_exception (except);
+ throw;
}
}
diff --git a/gdb/cp-abi.c b/gdb/cp-abi.c
index 23dad4b1748..8a9a284ab6c 100644
--- a/gdb/cp-abi.c
+++ b/gdb/cp-abi.c
@@ -82,7 +82,7 @@ baseclass_offset (struct type *type, int index, const gdb_byte *valaddr,
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
throw_error (NOT_AVAILABLE_ERROR,
_("Cannot determine virtual baseclass offset "
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 1d4c267e074..4f1bac1b45f 100644
--- a/gdb/darwin-nat.c
+++ b/gdb/darwin-nat.c
@@ -1693,7 +1693,7 @@ darwin_attach_pid (struct inferior *inf)
exit_inferior (inf);
inferior_ptid = null_ptid;
- throw_exception (ex);
+ throw;
}
target_ops *darwin_ops = get_native_target ();
diff --git a/gdb/dwarf2-frame.c b/gdb/dwarf2-frame.c
index 5067b94f834..c96594c7c0c 100644
--- a/gdb/dwarf2-frame.c
+++ b/gdb/dwarf2-frame.c
@@ -1076,7 +1076,7 @@ dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
return cache;
}
- throw_exception (ex);
+ throw;
}
/* Initialize the register state. */
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index 263d9c55e37..4251ee13d66 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -1209,7 +1209,7 @@ call_site_find_chain (struct gdbarch *gdbarch, CORE_ADDR caller_pc,
return NULL;
}
else
- throw_exception (e);
+ throw;
}
return retval;
@@ -2186,7 +2186,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
return allocate_optimized_out_value (subobj_type);
}
else
- throw_exception (ex);
+ throw;
}
if (ctx.pieces.size () > 0)
@@ -2398,7 +2398,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton,
return 0;
}
else
- throw_exception (ex);
+ throw;
}
switch (ctx.location)
diff --git a/gdb/eval.c b/gdb/eval.c
index f46222d920a..a337d9dd4b2 100644
--- a/gdb/eval.c
+++ b/gdb/eval.c
@@ -217,7 +217,7 @@ fetch_subexp_value (struct expression *exp, int *pc, struct value **valp,
break;
/* Fall through. */
default:
- throw_exception (ex);
+ throw;
break;
}
}
@@ -722,7 +722,7 @@ evaluate_var_value (enum noside noside, const block *blk, symbol *var)
catch (const struct gdb_exception_error &except)
{
if (noside != EVAL_AVOID_SIDE_EFFECTS)
- throw_exception (except);
+ throw;
ret = value_zero (SYMBOL_TYPE (var), not_lval);
}
@@ -964,7 +964,7 @@ evaluate_funcall (type *expect_type, expression *exp, int *pos,
if (except.error == NOT_FOUND_ERROR)
break;
else
- throw_exception (except);
+ throw;
}
arg2 = value;
@@ -2036,7 +2036,7 @@ evaluate_subexp_standard (struct type *expect_type,
if (except.error == NOT_FOUND_ERROR)
break;
else
- throw_exception (except);
+ throw;
}
arg1 = value;
diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c
index 714e44475ac..de559d02991 100644
--- a/gdb/frame-unwind.c
+++ b/gdb/frame-unwind.c
@@ -120,7 +120,7 @@ frame_unwind_try_unwinder (struct frame_info *this_frame, void **this_cache,
should always accept the frame. */
return 0;
}
- throw_exception (ex);
+ throw;
}
if (res)
diff --git a/gdb/frame.c b/gdb/frame.c
index 8665817658e..3a2f55b9ccb 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -922,7 +922,7 @@ frame_unwind_pc (struct frame_info *this_frame)
this_frame->level);
}
else
- throw_exception (ex);
+ throw;
}
if (pc_p)
@@ -1918,7 +1918,7 @@ get_prev_frame_if_no_cycle (struct frame_info *this_frame)
prev_frame->next = NULL;
this_frame->prev = NULL;
- throw_exception (ex);
+ throw;
}
return prev_frame;
@@ -2116,7 +2116,7 @@ get_prev_frame_always (struct frame_info *this_frame)
prev_frame = NULL;
}
else
- throw_exception (ex);
+ throw;
}
return prev_frame;
@@ -2385,7 +2385,7 @@ get_frame_pc_if_available (struct frame_info *frame, CORE_ADDR *pc)
if (ex.error == NOT_AVAILABLE_ERROR)
return 0;
else
- throw_exception (ex);
+ throw;
}
return 1;
@@ -2466,7 +2466,7 @@ get_frame_address_in_block_if_available (struct frame_info *this_frame,
{
if (ex.error == NOT_AVAILABLE_ERROR)
return 0;
- throw_exception (ex);
+ throw;
}
return 1;
@@ -2750,7 +2750,7 @@ get_frame_language (struct frame_info *frame)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
if (pc_p)
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 71eb5145ec0..62a67b60d77 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -1539,7 +1539,7 @@ linux_detach_one_lwp (struct lwp_info *lwp)
catch (const struct gdb_exception_error &ex)
{
if (!check_ptrace_stopped_lwp_gone (lwp))
- throw_exception (ex);
+ throw;
}
lwpid = lwpid_of (thread);
@@ -4511,7 +4511,7 @@ linux_resume_one_lwp (struct lwp_info *lwp,
catch (const struct gdb_exception_error &ex)
{
if (!check_ptrace_stopped_lwp_gone (lwp))
- throw_exception (ex);
+ throw;
}
}
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 35ad62b4d3b..d57d14e58f1 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -2089,7 +2089,7 @@ i386_frame_cache (struct frame_info *this_frame, void **this_cache)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
return cache;
@@ -2268,7 +2268,7 @@ i386_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
return cache;
@@ -2463,7 +2463,7 @@ i386_sigtramp_frame_cache (struct frame_info *this_frame, void **this_cache)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
*this_cache = cache;
diff --git a/gdb/inf-loop.c b/gdb/inf-loop.c
index 4cd179abfcf..d07c8f31295 100644
--- a/gdb/inf-loop.c
+++ b/gdb/inf-loop.c
@@ -79,7 +79,7 @@ inferior_event_handler (enum inferior_event_type event_type,
the prompt and is typing some unrelated command, so
just inform the user and swallow the exception. */
if (current_ui->prompt_state == PROMPT_BLOCKED)
- throw_exception (e);
+ throw;
else
exception_print (gdb_stderr, e);
}
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 024c5b832da..f943452ce82 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -454,7 +454,7 @@ post_create_inferior (struct target_ops *target, int from_tty)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
if (exec_bfd)
diff --git a/gdb/infrun.c b/gdb/infrun.c
index ed245133e9f..011c6525449 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -1784,7 +1784,7 @@ displaced_step_prepare (thread_info *thread)
if (ex.error != MEMORY_ERROR
&& ex.error != NOT_SUPPORTED_ERROR)
- throw_exception (ex);
+ throw;
if (debug_infrun)
{
@@ -2620,7 +2620,7 @@ resume (gdb_signal sig)
we're running in non-stop mode. */
if (inferior_ptid != null_ptid)
delete_single_step_breakpoints (inferior_thread ());
- throw_exception (ex);
+ throw;
}
}
diff --git a/gdb/linespec.c b/gdb/linespec.c
index dcf0b5ea4ec..b9c14ec53ad 100644
--- a/gdb/linespec.c
+++ b/gdb/linespec.c
@@ -3158,7 +3158,7 @@ event_location_to_sals (linespec_parser *parser,
}
catch (const struct gdb_exception_error &except)
{
- throw_exception (except);
+ throw;
}
}
break;
@@ -3972,7 +3972,7 @@ find_linespec_symbols (struct linespec_state *state,
catch (const struct gdb_exception_error &except)
{
if (except.error != NOT_FOUND_ERROR)
- throw_exception (except);
+ throw;
}
}
}
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 72cad8880e6..45435b6113e 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1409,7 +1409,7 @@ detach_one_lwp (struct lwp_info *lp, int *signo_p)
catch (const struct gdb_exception_error &ex)
{
if (!check_ptrace_stopped_lwp_gone (lp))
- throw_exception (ex);
+ throw;
}
if (ptrace (PTRACE_DETACH, lwpid, 0, signo) < 0)
@@ -1590,7 +1590,7 @@ linux_resume_one_lwp (struct lwp_info *lp, int step, enum gdb_signal signo)
catch (const struct gdb_exception_error &ex)
{
if (!check_ptrace_stopped_lwp_gone (lp))
- throw_exception (ex);
+ throw;
}
}
@@ -3542,7 +3542,7 @@ resume_stopped_resumed_lwps (struct lwp_info *lp, void *data)
catch (const struct gdb_exception_error &ex)
{
if (!check_ptrace_stopped_lwp_gone (lp))
- throw_exception (ex);
+ throw;
}
}
diff --git a/gdb/parse.c b/gdb/parse.c
index 627ae580105..4531fbaf4b3 100644
--- a/gdb/parse.c
+++ b/gdb/parse.c
@@ -1210,7 +1210,7 @@ parse_exp_in_context_1 (const char **stringptr, CORE_ADDR pc,
expression elements have been written, then there's nothing
to do, so fail. */
if (! parse_completion || ps.expout_ptr == 0)
- throw_exception (except);
+ throw;
}
/* We have to operate on an "expression *", due to la_post_parser,
diff --git a/gdb/record-btrace.c b/gdb/record-btrace.c
index ec45cb4aada..c505a2bf1ef 100644
--- a/gdb/record-btrace.c
+++ b/gdb/record-btrace.c
@@ -1484,7 +1484,7 @@ record_btrace_target::insert_breakpoint (struct gdbarch *gdbarch,
catch (const struct gdb_exception &except)
{
replay_memory_access = old;
- throw_exception (except);
+ throw;
}
replay_memory_access = old;
@@ -1514,7 +1514,7 @@ record_btrace_target::remove_breakpoint (struct gdbarch *gdbarch,
catch (const struct gdb_exception &except)
{
replay_memory_access = old;
- throw_exception (except);
+ throw;
}
replay_memory_access = old;
@@ -1992,7 +1992,7 @@ get_thread_current_frame_id (struct thread_info *tp)
/* Restore the previous execution state. */
set_executing (inferior_ptid, executing);
- throw_exception (except);
+ throw;
}
/* Restore the previous execution state. */
@@ -2073,7 +2073,7 @@ record_btrace_start_replaying (struct thread_info *tp)
registers_changed_thread (tp);
- throw_exception (except);
+ throw;
}
return replay;
@@ -2894,7 +2894,7 @@ cmd_record_btrace_bts_start (const char *args, int from_tty)
catch (const struct gdb_exception &exception)
{
record_btrace_conf.format = BTRACE_FORMAT_NONE;
- throw_exception (exception);
+ throw;
}
}
@@ -2915,7 +2915,7 @@ cmd_record_btrace_pt_start (const char *args, int from_tty)
catch (const struct gdb_exception &exception)
{
record_btrace_conf.format = BTRACE_FORMAT_NONE;
- throw_exception (exception);
+ throw;
}
}
@@ -2944,7 +2944,7 @@ cmd_record_btrace_start (const char *args, int from_tty)
catch (const struct gdb_exception &ex)
{
record_btrace_conf.format = BTRACE_FORMAT_NONE;
- throw_exception (ex);
+ throw;
}
}
}
diff --git a/gdb/record-full.c b/gdb/record-full.c
index 6b68e51ded5..4d0535bccbc 100644
--- a/gdb/record-full.c
+++ b/gdb/record-full.c
@@ -764,7 +764,7 @@ record_full_message (struct regcache *regcache, enum gdb_signal signal)
catch (const struct gdb_exception &ex)
{
record_full_list_release (record_full_arch_list_tail);
- throw_exception (ex);
+ throw;
}
record_full_list->next = record_full_arch_list_head;
@@ -1444,7 +1444,7 @@ record_full_wait_1 (struct target_ops *ops,
else
record_full_list = record_full_list->prev;
- throw_exception (ex);
+ throw;
}
}
@@ -2476,7 +2476,7 @@ record_full_restore (void)
catch (const struct gdb_exception &ex)
{
record_full_list_release (record_full_arch_list_tail);
- throw_exception (ex);
+ throw;
}
/* Add record_full_arch_list_head to the end of record list. */
diff --git a/gdb/remote.c b/gdb/remote.c
index c4d384f9bb7..c9402bebde1 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -5609,7 +5609,7 @@ remote_target::open_1 (const char *name, int from_tty, int extended_p)
already before throwing the exception. */
if (ex.error != TARGET_CLOSE_ERROR)
remote_unpush_target ();
- throw_exception (ex);
+ throw;
}
}
@@ -9784,7 +9784,7 @@ remote_target::remote_kill_k ()
/* Otherwise, something went wrong. We didn't actually kill
the target. Just propagate the exception, and let the
user or higher layers decide what to do. */
- throw_exception (ex);
+ throw;
}
}
@@ -13150,7 +13150,7 @@ remote_target::get_trace_status (struct trace_status *ts)
exception_fprintf (gdb_stderr, ex, "qTStatus: ");
return -1;
}
- throw_exception (ex);
+ throw;
}
result = packet_ok (p, &remote_protocol_packets[PACKET_qTStatus]);
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 5fc841d630b..d0c54ba475c 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -3471,7 +3471,7 @@ rs6000_frame_cache (struct frame_info *this_frame, void **this_cache)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
return (struct rs6000_frame_cache *) (*this_cache);
}
@@ -3700,7 +3700,7 @@ rs6000_epilogue_frame_cache (struct frame_info *this_frame, void **this_cache)
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
return cache;
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 2bef8293d96..9e0a3647e0c 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -2557,7 +2557,7 @@ s390_frame_unwind_cache (struct frame_info *this_frame,
catch (const struct gdb_exception_error &ex)
{
if (ex.error != NOT_AVAILABLE_ERROR)
- throw_exception (ex);
+ throw;
}
return info;
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index 31b66fa52d5..efbd9177292 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -141,7 +141,7 @@ append_ocl_sos (struct so_list **link_ptr)
case MEMORY_ERROR:
break;
default:
- throw_exception (ex);
+ throw;
break;
}
}
diff --git a/gdb/stack.c b/gdb/stack.c
index 0f8f4369043..b08fba759d9 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -2717,7 +2717,7 @@ frame_apply_command_count (const char *which_command,
if (flags.cont)
printf_filtered ("%s\n", ex.message.c_str ());
else
- throw_exception (ex);
+ throw;
}
}
}
diff --git a/gdb/target.c b/gdb/target.c
index 605383eeee8..ca25de0656d 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -762,7 +762,7 @@ target_translate_tls_address (struct objfile *objfile, CORE_ADDR offset)
objfile_name (objfile), ex.message.c_str ());
break;
default:
- throw_exception (ex);
+ throw;
break;
}
}
diff --git a/gdb/thread.c b/gdb/thread.c
index 2b84facbc27..b483e996e40 100644
--- a/gdb/thread.c
+++ b/gdb/thread.c
@@ -1481,7 +1481,7 @@ thr_try_catch_cmd (thread_info *thr, const char *cmd, int from_tty,
if (flags.cont)
printf_filtered ("%s\n", ex.message.c_str ());
else
- throw_exception (ex);
+ throw;
}
}
}
diff --git a/gdb/tracefile-tfile.c b/gdb/tracefile-tfile.c
index 95cd831a30d..c9e1f24df14 100644
--- a/gdb/tracefile-tfile.c
+++ b/gdb/tracefile-tfile.c
@@ -551,7 +551,7 @@ tfile_target_open (const char *arg, int from_tty)
{
/* Remove the partially set up target. */
unpush_target (&tfile_ops);
- throw_exception (ex);
+ throw;
}
inferior_appeared (current_inferior (), TFILE_PID);
diff --git a/gdb/valops.c b/gdb/valops.c
index d5efbc6abbb..0fc247e2b72 100644
--- a/gdb/valops.c
+++ b/gdb/valops.c
@@ -3634,7 +3634,7 @@ value_rtti_indirect_type (struct value *v, int *full,
type. */
return NULL;
}
- throw_exception (except);
+ throw;
}
}
else
--
2.17.2