From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15171 invoked by alias); 30 Apr 2010 16:08:03 -0000 Mailing-List: contact archer-help@sourceware.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Subscribe: List-Id: Received: (qmail 15093 invoked by uid 22791); 30 Apr 2010 16:08:01 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org From: Tom Tromey To: Jan Kratochvil Cc: archer@sourceware.org Subject: Re: [next-over-throw2] exception_resume_breakpoint comments References: <20100429164722.GA5666@host0.dyn.jankratochvil.net> Reply-To: Tom Tromey Date: Fri, 30 Apr 2010 16:08:00 -0000 In-Reply-To: <20100429164722.GA5666@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Thu, 29 Apr 2010 18:47:22 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2010-q2/txt/msg00017.txt.bz2 >>>>> "Jan" == Jan Kratochvil writes: Jan> - does not use TP at all. Thanks, I fixed this. It does need to use TP to make the exception-resume breakpoint thread-specific. Jan> Then clear_thread_inferior_resources now clears Jan> tp->step_resume_breakpoint. To make Jan> tp->exception_resume_breakpoint on par with existing tp-> Jan> step_resume_breakpoint IMO clear_thread_inferior_resources should Jan> clear even tp->exception_resume_breakpoint. I did this too. Jan> Unrelated bug is that both these breakpoints should be set as Jan> thread-specific. I think the bp_exception breakpoint is already thread-specific, see breakpoint.c:set_longjmp_breakpoint. When we clone the exception master breakpoint we also set its thread. The `TP' part of the new patch fixes the breakpoint we set to resume the exception. Jan> Another unrelated bug is that on a thread exit thread-specific Jan> breakpoints are not deleted (one may ask if they should be deleted, Jan> though). I'm not going to touch this in the general case. Maybe it is worth a bug report though. Here's what I plan to commit. I'm going to run it through the tester as well, just for a little safety. Tom diff --git a/gdb/infrun.c b/gdb/infrun.c index 3546cf1..40a1211 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -4946,6 +4946,7 @@ insert_exception_resume_breakpoint (struct thread_info *tp, bp = set_momentary_breakpoint_at_pc (get_frame_arch (frame), handler, bp_exception_resume); + bp->thread = tp->num; inferior_thread ()->exception_resume_breakpoint = bp; } } diff --git a/gdb/thread.c b/gdb/thread.c index 3c52ae4..eb0ef8f 100644 --- a/gdb/thread.c +++ b/gdb/thread.c @@ -113,6 +113,12 @@ clear_thread_inferior_resources (struct thread_info *tp) tp->step_resume_breakpoint = NULL; } + if (tp->exception_resume_breakpoint) + { + tp->exception_resume_breakpoint->disposition = disp_del_at_next_stop; + tp->exception_resume_breakpoint = NULL; + } + bpstat_clear (&tp->stop_bpstat); discard_all_intermediate_continuations_thread (tp);