From patchwork Sun Oct 8 17:07:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 23393 Received: (qmail 42081 invoked by alias); 8 Oct 2017 17:07:59 -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 41762 invoked by uid 89); 8 Oct 2017 17:07:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=REGISTER, collecting, tromey X-HELO: gproxy7-pub.mail.unifiedlayer.com Received: from gproxy7-pub.mail.unifiedlayer.com (HELO gproxy7-pub.mail.unifiedlayer.com) (70.40.196.235) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 08 Oct 2017 17:07:49 +0000 Received: from cmgw2 (unknown [10.0.90.83]) by gproxy7.mail.unifiedlayer.com (Postfix) with ESMTP id 11E8B215CB1 for ; Sun, 8 Oct 2017 11:07:48 -0600 (MDT) Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id K57k1w00G2f2jeq0157nBu; Sun, 08 Oct 2017 11:07:48 -0600 X-Authority-Analysis: v=2.2 cv=dZfw5Tfe c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=02M-m0pO-4AA:10 a=zstS-IiYAAAA:8 a=8yFU5mzi_QWSkXKT9OQA:9 a=4G6NA9xxw8l3yy4pmD5M:22 Received: from 75-166-4-236.hlrn.qwest.net ([75.166.4.236]:40508 helo=bapiya.localdomain) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.87) (envelope-from ) id 1e1F3I-001zcc-3L; Sun, 08 Oct 2017 11:07:44 -0600 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 2/3] Use bool in pv_area Date: Sun, 8 Oct 2017 11:07:40 -0600 Message-Id: <20171008170741.23151-3-tom@tromey.com> In-Reply-To: <20171008170741.23151-1-tom@tromey.com> References: <20171008170741.23151-1-tom@tromey.com> X-BWhitelist: no X-Exim-ID: 1e1F3I-001zcc-3L X-Source-Sender: 75-166-4-236.hlrn.qwest.net (bapiya.localdomain) [75.166.4.236]:40508 X-Source-Auth: tom+tromey.com X-Email-Count: 3 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-Local-Domain: yes This updates a couple of member functions in pv_area to return bool. gdb/ChangeLog 2017-10-07 Tom Tromey * prologue-value.h (pv_area::store_would_trash): Return bool. (pv_area::find_reg): Likewise. * prologue-value.c (pv_area::store_would_trash): Return bool. (pv_area::find_reg): Likewise. --- gdb/ChangeLog | 7 +++++++ gdb/prologue-value.c | 8 ++++---- gdb/prologue-value.h | 4 ++-- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gdb/prologue-value.c b/gdb/prologue-value.c index b830b8f50d..2b2e5a8b65 100644 --- a/gdb/prologue-value.c +++ b/gdb/prologue-value.c @@ -335,7 +335,7 @@ pv_area::~pv_area () } -int +bool pv_area::store_would_trash (pv_t addr) { /* It may seem odd that pvk_constant appears here --- after all, @@ -478,7 +478,7 @@ pv_area::fetch (pv_t addr, CORE_ADDR size) } -int +bool pv_area::find_reg (struct gdbarch *gdbarch, int reg, CORE_ADDR *offset_p) { struct area_entry *e = m_entry; @@ -493,14 +493,14 @@ pv_area::find_reg (struct gdbarch *gdbarch, int reg, CORE_ADDR *offset_p) { if (offset_p) *offset_p = e->offset; - return 1; + return true; } e = e->next; } while (e != m_entry); - return 0; + return false; } diff --git a/gdb/prologue-value.h b/gdb/prologue-value.h index e3004aa6ad..c6fd34bdab 100644 --- a/gdb/prologue-value.h +++ b/gdb/prologue-value.h @@ -269,7 +269,7 @@ public: prologue analysis, and return the information you've gathered, instead of losing all that information, most of which is probably okay. */ - int store_would_trash (pv_t addr); + bool store_would_trash (pv_t addr); /* Search AREA for the original value of REGISTER. If we can't find it, return zero; if we can find it, return a non-zero value, and if @@ -280,7 +280,7 @@ public: items stored in AREA. If you plan to gather a lot of information about registers saved in AREA, consider calling pv_area::scan instead, and collecting all your information in one pass. */ - int find_reg (struct gdbarch *gdbarch, int reg, CORE_ADDR *offset_p); + bool find_reg (struct gdbarch *gdbarch, int reg, CORE_ADDR *offset_p); /* For every part of AREA whose value we know, apply FUNC to CLOSURE,