This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH with testcase] Bug 11568 - delete thread-specific breakpoint on the thread exit
- From: Tom Tromey <tromey at redhat dot com>
- To: Muhammad Waqas <mwaqas at codesourcery dot com>
- Cc: Pedro Alves <palves at redhat dot com>, Yao Qi <yao at codesourcery dot com>, <gdb-patches at sourceware dot org>, <ali_anwar at codesourcery dot com>
- Date: Mon, 05 Aug 2013 07:57:13 -0600
- Subject: Re: [PATCH with testcase] Bug 11568 - delete thread-specific breakpoint on the thread exit
- References: <51F619CE dot 5040407 at codesourcery dot com> <51F633E5 dot 7000302 at codesourcery dot com> <51F65519 dot 2080806 at codesourcery dot com> <51F67992 dot 30704 at codesourcery dot com> <51F7967E dot 3060900 at codesourcery dot com> <51FA4D21 dot 4000309 at redhat dot com> <51FA5806 dot 7050505 at codesourcery dot com> <51FB7F9E dot 30701 at redhat dot com> <51FF941E dot 7060705 at codesourcery dot com>
>>>>> "Muhammad" == Muhammad Waqas <mwaqas@codesourcery.com> writes:
Muhammad> insertion_state_t;
Muhammad> +static void remove_threaded_breakpoints (struct thread_info *tp, int
Muhammad> silent);
Muhammad> +
Your patch got mangled by your mailer. This makes it hard to check the
formatting, so please fix that.
Muhammad> +static void
Muhammad> +remove_threaded_breakpoints(struct thread_info *tp, int silent)
Muhammad> +{
Needs an intro comment.
Muhammad> +
Muhammad> + if (b->thread > 0)
Muhammad> + {
Muhammad> + observer_attach_thread_exit (remove_threaded_breakpoints);
Muhammad> + }
It seems odd to re-register the observer each time.
Why not just do it once, at initialization time?
Muhammad> 2013-07-24 Muhammad Waqas <mwaqas@codesourccery.com>
Muhammad> Jan Kratochvil <jan.kartochvil@redhat.com>
Muhammad> PR gdb/11568
Muhammad> *gdb.thread/thread-specific-bp.c: Newfile.
Muhammad> *gdb.thread/thread-specific-bp.exp: Newfile.
Space after "*" and in "New file".
Muhammad> +set mode "All stop"
Muhammad> +
Muhammad> +if {[gdb_compile_pthreads \
Muhammad> + "${srcdir}/${subdir}/${srcfile}" \
Muhammad> + "${binfile}" executable {debug} ] != "" } {
Muhammad> + return -1
Muhammad> +}
Muhammad> +
Muhammad> +clean_restart ${binfile}
Muhammad> +
Muhammad> +proc check_threaded_breakpoint {} {
Muhammad> + global gdb_prompt mode
Make "mode" a parameter.
Use with_test_prefix, since otherwise the new .exp will have repeated
test names, an gdb anti-pattern.
Muhammad> +# Testing in non-stop+async mode.
Muhammad> +set mode "non-stop\\async"
It's better to simply not use an unusual character.
Tom