From patchwork Wed Mar 4 14:26:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 45418 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1D64821416 for ; Wed, 4 Mar 2015 14:26:21 +0000 (UTC) Received: by wggy19 with SMTP id y19sf34175442wgg.1 for ; Wed, 04 Mar 2015 06:26:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:mailing-list :precedence:list-id:list-unsubscribe:list-subscribe:list-archive :list-post:list-help:sender:delivered-to:from:to:subject:date :message-id:x-original-sender:x-original-authentication-results; bh=38sxcQ31M92QNCdYVQg9ueMn/eic7rnMwxm/tJ0eFy4=; b=iVWVi0/rzp3id+KeJnZdNkGJ/T25PlnSWJitybR3ppCI6peaKEKy9oxG3S4lzslc4W 0yCOqlRHSEQe451hX5Dyzc9iR1OjFUduMbCFSyt+zXea/exE86xyLjLnXRloTp/vH1c6 XcTGzDRRehk0ouDHmdG4jEwhD+YQDOD+kVf6hq0QHBfP746ymB08LCZNTMvHQ9Ym+/Ub BKxPvi2da7kF1TTigynPlAeZZzTDYbU9C4EediM9EdpYq6dS4N16g18yAEi9le6bNHJd uDhm4NZz6nONrSM6+5vCJQJwvVT/f4pp/uBROxiassWPDCHtGfJjz24j6wNkFJzm5JoX eu2g== X-Gm-Message-State: ALoCoQn6H+8OTPYyGvSDBnCxPx9xjSRGBlf+eeuW5rrvOS+wOdrVmeVErjLPqqXdJKHdJCO1PoBI X-Received: by 10.152.1.5 with SMTP id 5mr724268lai.4.1425479180410; Wed, 04 Mar 2015 06:26:20 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.200 with SMTP id la8ls185631lac.90.gmail; Wed, 04 Mar 2015 06:26:20 -0800 (PST) X-Received: by 10.112.12.4 with SMTP id u4mr1598195lbb.4.1425479180233; Wed, 04 Mar 2015 06:26:20 -0800 (PST) Received: from mail-la0-x22e.google.com (mail-la0-x22e.google.com. [2a00:1450:4010:c03::22e]) by mx.google.com with ESMTPS id k7si2591770lbd.114.2015.03.04.06.26.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 06:26:20 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22e as permitted sender) client-ip=2a00:1450:4010:c03::22e; Received: by labgq15 with SMTP id gq15so44954880lab.3 for ; Wed, 04 Mar 2015 06:26:20 -0800 (PST) X-Received: by 10.112.130.39 with SMTP id ob7mr3863086lbb.32.1425479179936; Wed, 04 Mar 2015 06:26:19 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1252863lbj; Wed, 4 Mar 2015 06:26:19 -0800 (PST) X-Received: by 10.70.6.1 with SMTP id w1mr7479582pdw.62.1425479178188; Wed, 04 Mar 2015 06:26:18 -0800 (PST) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id bq1si5321359pbc.88.2015.03.04.06.26.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Mar 2015 06:26:18 -0800 (PST) Received-SPF: pass (google.com: domain of gdb-patches-return-120462-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 119318 invoked by alias); 4 Mar 2015 14:26:11 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list 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 119306 invoked by uid 89); 4 Mar 2015 14:26:10 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.3 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, KAM_FROM_URIBL_PCCC, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-pd0-f177.google.com Received: from mail-pd0-f177.google.com (HELO mail-pd0-f177.google.com) (209.85.192.177) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 04 Mar 2015 14:26:08 +0000 Received: by pdev10 with SMTP id v10so11310862pde.0 for ; Wed, 04 Mar 2015 06:26:07 -0800 (PST) X-Received: by 10.70.37.134 with SMTP id y6mr7258425pdj.13.1425479166965; Wed, 04 Mar 2015 06:26:06 -0800 (PST) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by mx.google.com with ESMTPSA id kd6sm4216606pbb.40.2015.03.04.06.26.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 04 Mar 2015 06:26:06 -0800 (PST) From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH] Use show_debug_regs as a boolean Date: Wed, 4 Mar 2015 14:26:02 +0000 Message-Id: <1425479162-25801-1-git-send-email-qiyaoltc@gmail.com> X-IsSubscribed: yes X-Original-Sender: qiyaoltc@gmail.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2a00:1450:4010:c03::22e as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@sourceware.org; dmarc=fail (p=NONE dis=NONE) header.from=gmail.com X-Google-Group-Id: 836684582541 From: Yao Qi I happen to see that show_debug_regs is used as an arithmetic type, but it should be a boolean, if (show_debug_regs > 1) On the other hand, GDB RSP only allows setting it to either 0 or 1, so it makes no sense to check whether it is greater than 1. This patch fixes it. gdb/gdbserver: 2015-03-04 Yao Qi * linux-aarch64-low.c (aarch64_insert_point): Use show_debug_regs as a boolean. (aarch64_remove_point): Likewise. --- gdb/gdbserver/linux-aarch64-low.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index a34fe5d..7934e78 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -990,7 +990,7 @@ aarch64_insert_point (enum raw_bkpt_type type, CORE_ADDR addr, ret = aarch64_handle_breakpoint (targ_type, addr, len, 1 /* is_insert */); - if (show_debug_regs > 1) + if (show_debug_regs) aarch64_show_debug_reg_state (aarch64_get_debug_reg_state (), "insert_point", addr, len, targ_type); @@ -1027,7 +1027,7 @@ aarch64_remove_point (enum raw_bkpt_type type, CORE_ADDR addr, ret = aarch64_handle_breakpoint (targ_type, addr, len, 0 /* is_insert */); - if (show_debug_regs > 1) + if (show_debug_regs) aarch64_show_debug_reg_state (aarch64_get_debug_reg_state (), "remove_point", addr, len, targ_type);