From patchwork Wed Sep 23 14:46:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 8828 Received: (qmail 78781 invoked by alias); 23 Sep 2015 14:46:31 -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 78762 invoked by uid 89); 23 Sep 2015 14:46:30 -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-f41.google.com Received: from mail-pa0-f41.google.com (HELO mail-pa0-f41.google.com) (209.85.220.41) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 23 Sep 2015 14:46:29 +0000 Received: by pacfv12 with SMTP id fv12so43105985pac.2 for ; Wed, 23 Sep 2015 07:46:28 -0700 (PDT) X-Received: by 10.67.4.230 with SMTP id ch6mr38645377pad.11.1443019587996; Wed, 23 Sep 2015 07:46:27 -0700 (PDT) Received: from E107787-LIN (power-aix.osuosl.org. [140.211.15.154]) by smtp.gmail.com with ESMTPSA id la4sm8401348pbc.76.2015.09.23.07.46.25 (version=TLS1_2 cipher=AES128-SHA256 bits=128/128); Wed, 23 Sep 2015 07:46:27 -0700 (PDT) From: Yao Qi To: Antoine Tremblay Cc: Yao Qi , Subject: Re: [PATCH 1/5] Support multiple breakpoint types per target in GDBServer. References: <1442577749-6650-1-git-send-email-antoine.tremblay@ericsson.com> <1442577749-6650-2-git-send-email-antoine.tremblay@ericsson.com> <86oagt9znr.fsf@gmail.com> <56029CF3.8000001@ericsson.com> Date: Wed, 23 Sep 2015 15:46:22 +0100 In-Reply-To: <56029CF3.8000001@ericsson.com> (Antoine Tremblay's message of "Wed, 23 Sep 2015 08:37:07 -0400") Message-ID: <86h9ml9osh.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: >> PC can't be NULL after your patch #2. You can remove the second >> sentence in this patch or patch #2. >> > I think you mean after patch #3 ? > > But it can still be NULL see in #3 : > > /* Default if no pc is set to arm breakpoint. */ > + if (pcptr == NULL) > + { > + *lenptr = arm_breakpoint_len; > + return (unsigned char *) &arm_breakpoint; > + } I meant this change below in patch #2, We only pass NULL to breakpoint_from_pc here, and we remove it from patch #2. That is why I suggest that PCPTR can't be NULL. [I am still reviewing this patch series. I get something I can't explain after I enable thread event breakpoint in order to exercise your patches. I'll send out my comments once I understand the them fully.] diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index bb08761..06387a0 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -7069,16 +7069,10 @@ void initialize_low (void) { struct sigaction sigchld_action; - int breakpoint_len = 0; - const unsigned char *breakpoint = NULL; memset (&sigchld_action, 0, sizeof (sigchld_action)); set_target_ops (&linux_target_ops); - breakpoint = the_target->breakpoint_from_pc (NULL, &breakpoint_len); - - set_breakpoint_data (breakpoint, - breakpoint_len); linux_init_signals (); linux_ptrace_init_warnings ();