From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 98199 invoked by alias); 15 Oct 2015 08:27:05 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 98178 invoked by uid 89); 15 Oct 2015 08:27:04 -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-f48.google.com Received: from mail-pa0-f48.google.com (HELO mail-pa0-f48.google.com) (209.85.220.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 15 Oct 2015 08:27:03 +0000 Received: by pabws5 with SMTP id ws5so17270539pab.3 for ; Thu, 15 Oct 2015 01:27:02 -0700 (PDT) X-Received: by 10.66.246.162 with SMTP id xx2mr8584700pac.144.1444897621953; Thu, 15 Oct 2015 01:27:01 -0700 (PDT) Received: from E107787-LIN (gcc2-power8.osuosl.org. [140.211.9.43]) by smtp.gmail.com with ESMTPSA id tj2sm13951408pab.4.2015.10.15.01.27.00 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Thu, 15 Oct 2015 01:27:01 -0700 (PDT) From: Yao Qi To: Antoine Tremblay Cc: Subject: Re: [PATCH v2 1/7] Add breakpoint_from_pc target_ops for software breakpoints in GDBServer. References: <1444063455-31558-1-git-send-email-antoine.tremblay@ericsson.com> <1444063455-31558-2-git-send-email-antoine.tremblay@ericsson.com> Date: Thu, 15 Oct 2015 08:27:00 -0000 In-Reply-To: <1444063455-31558-2-git-send-email-antoine.tremblay@ericsson.com> (Antoine Tremblay's message of "Mon, 5 Oct 2015 12:44:09 -0400") Message-ID: <86bnc04jvx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg00236.txt.bz2 Antoine Tremblay writes: > diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c > index 3a1a6ae..dc16fe0 100644 > --- a/gdb/gdbserver/linux-low.c > +++ b/gdb/gdbserver/linux-low.c > @@ -3012,7 +3012,11 @@ linux_wait_1 (ptid_t ptid, > if (!ptid_equal (step_over_bkpt, null_ptid) > && event_child->stop_reason =3D=3D TARGET_STOPPED_BY_SW_BREAKPOINT) > { > - unsigned int increment_pc =3D the_low_target.breakpoint_len; > + int increment_pc =3D 0; > + CORE_ADDR stop_pc =3D event_child->stop_pc; > + > + (*the_low_target.breakpoint_from_pc) > + (&stop_pc, &increment_pc); >=20=20 They can be in the same line. > if (debug_threads) > { > @@ -6932,6 +6936,15 @@ current_lwp_ptid (void) > return ptid_of (current_thread); > } >=20=20 > +const unsigned char * > +linux_breakpoint_from_pc (CORE_ADDR *pcptr, int *lenptr) > +{ > + if (the_low_target.breakpoint_from_pc !=3D NULL) > + return (*the_low_target.breakpoint_from_pc) (pcptr, lenptr); > + else > + return NULL; > +} If the breakpoint_from_pc is NULL, this GDBserver port should be broken. We can use gdb_assert to assert the_low_target.breakpoint_from_pc isn't NULL. Otherwise the patch looks good to me. --=20 Yao (=E9=BD=90=E5=B0=A7)