From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 51481 invoked by alias); 27 Oct 2017 09:31:52 -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 51449 invoked by uid 89); 27 Oct 2017 09:31:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00,FREEMAIL_FROM,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=cooked, membership, onto, 20171018 X-HELO: mail-wm0-f66.google.com Received: from mail-wm0-f66.google.com (HELO mail-wm0-f66.google.com) (74.125.82.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Oct 2017 09:31:50 +0000 Received: by mail-wm0-f66.google.com with SMTP id t139so2480437wmt.1 for ; Fri, 27 Oct 2017 02:31:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=wMWYTKEp4Ka9+eOw2uv2TNyNXeBU6f4HY2Ha7/bNnxE=; b=ovop0CTbpsFxFKFYe9O58JZ0zGYqdPL5BT0OO4bbYetfU+LBtbUn08DCYNQn6G/HHF Sj5aXKJwMIQU0PmyCfMb+MidDYC0yOTHIIAr5Z1QwYXQeqNfTbRVUDOt/VdQ6+N+chR+ CyCIjWGjG5e2Yv+dmyuQ2eDKuvuWp/4+RIxGmax2DgP8tvemhREtYKxyemkRS3ISe3v2 rMT+NH1r8xAzPB/gtuTYS5nJzjdDOxMc2EGcSBdBsE08HhCY6X/ipgeETOd0ri5858Cy oLeNJnKHN7t9k4U0+eAjZl074yIL8RrtCW7goRvbi9y8J0+G3GVxPq4A+7rkHNmDNGzE UaJA== X-Gm-Message-State: AMCzsaV34I5O9gABjo2WfTuXS/fisPHE+oMsj1JbSk52FoUR7WeIbk+e aIr4K1NZ145MDaTz8Y16D7TZ8A== X-Google-Smtp-Source: ABhQp+SfbvOJotEg88DBeQ2GSWooXwP4TBCL/RO0yZP41v0vQ70MLnAVPTvUcrWdhMxIqeAS06/gUg== X-Received: by 10.28.63.134 with SMTP id m128mr53363wma.137.1509096708670; Fri, 27 Oct 2017 02:31:48 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id r29sm10349378wra.71.2017.10.27.02.31.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 27 Oct 2017 02:31:48 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 1/8] Remove regcache_descr fields sizeof_raw_register_status and sizeof_cooked_register_status Date: Fri, 27 Oct 2017 09:31:00 -0000 Message-Id: <1509096702-12202-2-git-send-email-yao.qi@linaro.org> In-Reply-To: <1509096702-12202-1-git-send-email-yao.qi@linaro.org> References: <1509096702-12202-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00841.txt.bz2 struct regcache_descr has two fields sizeof_raw_register_status and sizeof_cooked_register_status, but they equal to nr_cooked_registers and nr_raw_registers respectively, so this patch removes them. gdb: 2017-10-18 Yao Qi * regcache.c (struct regcache_descr) : Remove. : Remove. (init_regcache_descr): Update. (regcache::regcache): Use nr_cooked_registers and nr_raw_registers. (regcache::save): Likewise. (regcache::dump): Likewise. --- gdb/regcache.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/gdb/regcache.c b/gdb/regcache.c index 1ba49ad..5a1152e 100644 --- a/gdb/regcache.c +++ b/gdb/regcache.c @@ -53,7 +53,6 @@ struct regcache_descr cache. */ int nr_raw_registers; long sizeof_raw_registers; - long sizeof_raw_register_status; /* The cooked register space. Each cooked register in the range [0..NR_RAW_REGISTERS) is direct-mapped onto the corresponding raw @@ -63,7 +62,6 @@ struct regcache_descr gdbarch_pseudo_register_read and gdbarch_pseudo_register_write. */ int nr_cooked_registers; long sizeof_cooked_registers; - long sizeof_cooked_register_status; /* Offset and size (in 8 bit bytes), of each register in the register cache. All registers (including those in the range @@ -92,8 +90,6 @@ init_regcache_descr (struct gdbarch *gdbarch) either mapped onto raw-registers or memory. */ descr->nr_cooked_registers = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch); - descr->sizeof_cooked_register_status - = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch); /* Fill in a table of register types. */ descr->register_type @@ -105,7 +101,6 @@ init_regcache_descr (struct gdbarch *gdbarch) /* Construct a strictly RAW register cache. Don't allow pseudo's into the register cache. */ descr->nr_raw_registers = gdbarch_num_regs (gdbarch); - descr->sizeof_raw_register_status = gdbarch_num_regs (gdbarch); /* Lay out the register cache. @@ -199,13 +194,13 @@ regcache::regcache (gdbarch *gdbarch, address_space *aspace_, { m_registers = XCNEWVEC (gdb_byte, m_descr->sizeof_cooked_registers); m_register_status = XCNEWVEC (signed char, - m_descr->sizeof_cooked_register_status); + m_descr->nr_cooked_registers); } else { m_registers = XCNEWVEC (gdb_byte, m_descr->sizeof_raw_registers); m_register_status = XCNEWVEC (signed char, - m_descr->sizeof_raw_register_status); + m_descr->nr_raw_registers); } m_ptid = minus_one_ptid; } @@ -306,7 +301,7 @@ regcache::save (regcache_cooked_read_ftype *cooked_read, gdb_assert (m_readonly_p); /* Clear the dest. */ memset (m_registers, 0, m_descr->sizeof_cooked_registers); - memset (m_register_status, 0, m_descr->sizeof_cooked_register_status); + memset (m_register_status, 0, m_descr->nr_cooked_registers); /* Copy over any registers (identified by their membership in the save_reggroup) and mark them as valid. The full [0 .. gdbarch_num_regs + gdbarch_num_pseudo_regs) range is checked since some architectures need @@ -1343,7 +1338,7 @@ regcache::dump (ui_file *file, enum regcache_dump_what what_to_dump) fprintf_unfiltered (file, "sizeof_raw_registers %ld\n", m_descr->sizeof_raw_registers); fprintf_unfiltered (file, "sizeof_raw_register_status %ld\n", - m_descr->sizeof_raw_register_status); + m_descr->nr_raw_registers); fprintf_unfiltered (file, "gdbarch_num_regs %d\n", gdbarch_num_regs (gdbarch)); fprintf_unfiltered (file, "gdbarch_num_pseudo_regs %d\n", -- 1.9.1