Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Antoine Tremblay <antoine.tremblay@ericsson.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [pushed] gdbserver: redo stepping over breakpoint that was on top of a permanent breakpoint
Date: Thu, 24 Sep 2015 13:21:00 -0000	[thread overview]
Message-ID: <86wpvg7y22.fsf@gmail.com> (raw)
In-Reply-To: <5603E0F7.10205@ericsson.com> (Antoine Tremblay's message of	"Thu, 24 Sep 2015 07:39:35 -0400")

Antoine Tremblay <antoine.tremblay@ericsson.com> writes:

> Indeed I have a fix for this see :
> https://sourceware.org/ml/gdb-patches/2015-09/msg00222.html
>

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.

-- 
Yao (齐尧)

diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index 9fb83a8..0d88694 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -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
      threads.  */
-  thread_db_init (!linux_supports_traceclone ());
+  thread_db_init (1/*!linux_supports_traceclone ()*/);
 #endif
 }
 
diff --git a/gdb/remote.c b/gdb/remote.c
index b9dc4af..f1dec19 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -4157,6 +4157,13 @@ remote_check_symbols (void)
 							 sym_addr,
 							 &current_target);
 
+	  /* 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[8]);
 	}


  reply	other threads:[~2015-09-24 13:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-23 20:27 Pedro Alves
2015-02-24 12:25 ` Yao Qi
2015-02-26 19:01   ` Pedro Alves
2015-09-24 10:43 ` Yao Qi
2015-09-24 11:39   ` Antoine Tremblay
2015-09-24 13:21     ` Yao Qi [this message]
2015-09-24 16:43       ` Antoine Tremblay

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=86wpvg7y22.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    /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