From patchwork Mon Jul 14 14:47:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Edjunior Barbosa Machado X-Patchwork-Id: 2051 Received: (qmail 9721 invoked by alias); 14 Jul 2014 14:48:05 -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 9523 invoked by uid 89); 14 Jul 2014 14:48:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e24smtp05.br.ibm.com Received: from e24smtp05.br.ibm.com (HELO e24smtp05.br.ibm.com) (32.104.18.26) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 14 Jul 2014 14:48:02 +0000 Received: from /spool/local by e24smtp05.br.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 14 Jul 2014 11:47:57 -0300 Received: from d24dlp02.br.ibm.com (9.18.248.206) by e24smtp05.br.ibm.com (10.172.0.141) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 14 Jul 2014 11:47:55 -0300 Received: from d24relay01.br.ibm.com (d24relay01.br.ibm.com [9.8.31.16]) by d24dlp02.br.ibm.com (Postfix) with ESMTP id 1D0141DC0051 for ; Mon, 14 Jul 2014 10:47:55 -0400 (EDT) Received: from d24av01.br.ibm.com (d24av01.br.ibm.com [9.8.31.91]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s6EEmB28225286 for ; Mon, 14 Jul 2014 11:48:11 -0300 Received: from d24av01.br.ibm.com (localhost [127.0.0.1]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s6EElhII032616 for ; Mon, 14 Jul 2014 11:47:43 -0300 Received: from grandaddy.ibm.com ([9.78.128.31]) by d24av01.br.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id s6EElhge032570; Mon, 14 Jul 2014 11:47:43 -0300 From: Edjunior Barbosa Machado To: gdb-patches@sourceware.org Cc: uweigand@de.ibm.com Subject: [PATCH] Report "No hardware breakpoint support" correctly Date: Mon, 14 Jul 2014 11:47:35 -0300 Message-Id: <1405349255-26782-1-git-send-email-emachado@linux.vnet.ibm.com> X-TM-AS-MML: disable x-cbid: 14071414-1798-0000-0000-000003278960 X-IsSubscribed: yes Hi, when trying to set a hardware breakpoint on Power server processors, gdb currently reports "Hardware breakpoints used exceeds limit." when in fact hbreaks are not supported. With this patch, gdb will report "No hardware breakpoint support in the target.", which seems to be more appropriate in this case. This also fixes the several unexpected failures in gdb.base/watchpoint-reuse-slot.exp testcase, that didn't detect that hbreaks are not supported in this target. Ok? Thanks and regards, --- Edjunior gdb/ 2014-07-14 Edjunior Barbosa Machado * gdb/ppc-linux-nat.c (ppc_linux_can_use_hw_breakpoint): Report no hardware breakpoint support correctly. --- gdb/ppc-linux-nat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index fcfd452..4c5d878 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -1473,6 +1473,9 @@ ppc_linux_can_use_hw_breakpoint (struct target_ops *self, } else if (type == bp_hardware_breakpoint) { + if (total_hw_bp == 0) + /* No hardware breakpoint support. */ + return 0; if (cnt > total_hw_bp) return -1; }