From patchwork Thu Sep 24 13:21:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 8837 Received: (qmail 111280 invoked by alias); 24 Sep 2015 13:21:35 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 111064 invoked by uid 89); 24 Sep 2015 13:21:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f45.google.com Received: from mail-pa0-f45.google.com (HELO mail-pa0-f45.google.com) (209.85.220.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 24 Sep 2015 13:21:32 +0000 Received: by pacfv12 with SMTP id fv12so74438610pac.2 for ; Thu, 24 Sep 2015 06:21:31 -0700 (PDT) X-Received: by 10.66.152.200 with SMTP id va8mr44626654pab.17.1443100890887; Thu, 24 Sep 2015 06:21:30 -0700 (PDT) Received: from E107787-LIN (power-aix.osuosl.org. [140.211.15.154]) by smtp.gmail.com with ESMTPSA id uy4sm13712834pbc.69.2015.09.24.06.21.28 (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Thu, 24 Sep 2015 06:21:30 -0700 (PDT) From: Yao Qi To: Antoine Tremblay Cc: Subject: Re: [pushed] gdbserver: redo stepping over breakpoint that was on top of a permanent breakpoint References: <1424723261-15719-1-git-send-email-palves@redhat.com> <861tdo9jy6.fsf@gmail.com> <5603E0F7.10205@ericsson.com> Date: Thu, 24 Sep 2015 14:21:25 +0100 In-Reply-To: <5603E0F7.10205@ericsson.com> (Antoine Tremblay's message of "Thu, 24 Sep 2015 07:39:35 -0400") Message-ID: <86wpvg7y22.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 X-IsSubscribed: yes Antoine Tremblay 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. 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, ¤t_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]); }