This is the mail archive of the
mailing list for the GDB project.
Re: [pushed] gdbserver: redo stepping over breakpoint that was on top of a permanent breakpoint
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- Cc: <gdb-patches at sourceware dot org>
- Date: Thu, 24 Sep 2015 14:21:25 +0100
- Subject: Re: [pushed] gdbserver: redo stepping over breakpoint that was on top of a permanent breakpoint
- Authentication-results: sourceware.org; auth=none
- References: <1424723261-15719-1-git-send-email-palves at redhat dot com> <861tdo9jy6 dot fsf at gmail dot com> <5603E0F7 dot 10205 at ericsson dot com>
Antoine Tremblay <firstname.lastname@example.org> writes:
> Indeed I have a fix for this see :
Ah, I did read your patch, but I forget it when I am fixing this problem.
> But I thought it would not trigger until conditional breakpoints are
> implemented thus I had not included it in this patchset.
> Could you share how exactly you get GDBServer to insert an internal
> breakpoint, I'm unfamiliar with : "I force GDBserver to use thread
> event breakpoint" ?
It can be triggered when GDBserver steps over its breakpoints, what I
did is to pass 1 to thread_db_init, so that GDBserver will insert
breakpoint on __nptl_create_event. Once a new thread is created, and
hits this breakpoint, GDBserver will step over this breakpoint.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 9fb83a8..0d88694 100644
@@ -5501,7 +5501,7 @@ linux_look_up_symbols (void)
/* If the kernel supports tracing clones, then we don't need to
use the magic thread event breakpoint to learn about
- thread_db_init (!linux_supports_traceclone ());
+ thread_db_init (1/*!linux_supports_traceclone ()*/);
diff --git a/gdb/remote.c b/gdb/remote.c
index b9dc4af..f1dec19 100644
@@ -4157,6 +4157,13 @@ remote_check_symbols (void)
+ /* Hack for arm gdbserver when the thread library is compiled in
+ thumb mode. Set the LSB of address of __nptl_create_event so
+ that GDBserver can choose the right breakpoint instruction to
+ set on it. */
+ if (strcmp ("__nptl_create_event", msg) == 0)
+ sym_addr |= 1;
xsnprintf (msg, get_remote_packet_size (), "qSymbol:%s:%s",
phex_nz (sym_addr, addr_size), &reply);