From e93ca0199f5ea2bec534cf051c2007641f952f82 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Fri, 26 Aug 2011 09:28:27 +0000 Subject: [PATCH] gdb/ No functionality change. * breakpoint.c (bpstat_clear_actions): Remove the BS parameter, make function comment a reference, new variables tp and bs, move here code from throw_exception. * breakpoint.h (bpstat_clear_actions): Remove the BS parameter, describe it in the comment. * exceptions.c (throw_exception): Remove variable tp, move the code for bpstat_clear_actions to bpstat_clear_actions. --- gdb/ChangeLog | 11 +++++++++++ gdb/breakpoint.c | 16 +++++++++++++--- gdb/breakpoint.h | 5 +++-- gdb/exceptions.c | 11 +---------- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1da536e7fd..aad31ec95f 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2011-08-26 Jan Kratochvil + + No functionality change. + * breakpoint.c (bpstat_clear_actions): Remove the BS parameter, make + function comment a reference, new variables tp and bs, move here code + from throw_exception. + * breakpoint.h (bpstat_clear_actions): Remove the BS parameter, + describe it in the comment. + * exceptions.c (throw_exception): Remove variable tp, move the code for + bpstat_clear_actions to bpstat_clear_actions. + 2011-08-24 Luis Machado * linux-nat.h (linux_proc_get_tgid): Remove declaration. diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index d1d325ebca..6ccdb6d015 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3186,12 +3186,22 @@ bpstat_num (bpstat *bsp, int *num) return 1; } -/* Modify BS so that the actions will not be performed. */ +/* See breakpoint.h. */ void -bpstat_clear_actions (bpstat bs) +bpstat_clear_actions (void) { - for (; bs != NULL; bs = bs->next) + struct thread_info *tp; + bpstat bs; + + if (ptid_equal (inferior_ptid, null_ptid)) + return; + + tp = find_thread_ptid (inferior_ptid); + if (tp == NULL) + return; + + for (bs = tp->control.stop_bpstat; bs != NULL; bs = bs->next) { decref_counted_command_line (&bs->commands); diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index 146ed7e656..5e5d1b9028 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -895,8 +895,9 @@ extern int bpstat_num (bpstat *, int *); command loop). */ extern void bpstat_do_actions (void); -/* Modify BS so that the actions will not be performed. */ -extern void bpstat_clear_actions (bpstat); +/* Modify all entries of STOP_BPSTAT of INFERIOR_PTID so that the actions will + not be performed. */ +extern void bpstat_clear_actions (void); /* Implementation: */ diff --git a/gdb/exceptions.c b/gdb/exceptions.c index 559e8ede32..e9fdb26555 100644 --- a/gdb/exceptions.c +++ b/gdb/exceptions.c @@ -207,21 +207,12 @@ exceptions_state_mc_action_iter_1 (void) void throw_exception (struct gdb_exception exception) { - struct thread_info *tp = NULL; - quit_flag = 0; immediate_quit = 0; - if (!ptid_equal (inferior_ptid, null_ptid)) - tp = find_thread_ptid (inferior_ptid); - /* Perhaps it would be cleaner to do this via the cleanup chain (not sure I can think of a reason why that is vital, though). */ - if (tp != NULL) - { - /* Clear queued breakpoint commands. */ - bpstat_clear_actions (tp->control.stop_bpstat); - } + bpstat_clear_actions (); do_cleanups (ALL_CLEANUPS); -- 2.34.1