From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: [patch 1/2] Code reshuffle for patch 2/2 [Re: [patch] Do not bpstat_clear_actions on throw_exception]
Date: Mon, 22 Aug 2011 14:52:00 -0000 [thread overview]
Message-ID: <20110822145142.GA11817@host1.jankratochvil.net> (raw)
In-Reply-To: <201108181742.19980.pedro@codesourcery.com>
Hi,
just some code moving. Not sure if bpstat_clear_actions name should stay the
same but why not.
Thanks,
Jan
gdb/
2011-08-21 Jan Kratochvil <jan.kratochvil@redhat.com>
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.
--- 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);
--- 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: */
--- 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);
next prev parent reply other threads:[~2011-08-22 14:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-05 20:14 [patch] Do not bpstat_clear_actions on throw_exception Jan Kratochvil
2011-08-08 15:44 ` Pedro Alves
2011-08-18 15:34 ` Jan Kratochvil
2011-08-18 16:42 ` Pedro Alves
2011-08-18 19:05 ` [patch] Code cleanup: Remove commands_left [Do not bpstat_clear_actions on throw_exception] Jan Kratochvil
2011-08-21 14:34 ` Jan Kratochvil
2011-08-22 14:52 ` Jan Kratochvil [this message]
2011-08-26 9:29 ` [patch 1/2] Code reshuffle for patch 2/2 [Re: [patch] Do " Jan Kratochvil
2011-08-26 12:07 ` Pedro Alves
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110822145142.GA11817@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox