From patchwork Thu Nov 3 09:48:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 17143 Received: (qmail 29836 invoked by alias); 3 Nov 2016 09:48:35 -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 29473 invoked by uid 89); 3 Nov 2016 09:48:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-spam-relays-external:209.85.192.194, H*RU:209.85.192.194 X-HELO: mail-pf0-f194.google.com Received: from mail-pf0-f194.google.com (HELO mail-pf0-f194.google.com) (209.85.192.194) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 03 Nov 2016 09:48:31 +0000 Received: by mail-pf0-f194.google.com with SMTP id i88so4370027pfk.2 for ; Thu, 03 Nov 2016 02:48:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=jgmmr8YtAac+JnSo8a3GqE0YBOE4LpJfKiIin0j9TJg=; b=iqCldCCpg+SNIDnCbKzJIowgdaN22rs9vK0vHvgv76e0tG4QzQkWZIXWX4pn4xbhn8 0HXHQHsKd1PpI49P9mRWLyMyaEbB5E779Ij90wfWdmVXpTEKw76+IQcn1/ydbVu7tkta dtIj9MJfn7/IayB0oalC8pRjyvttRD3ddsbaBq5me2VV6E0C9Tf8IVEFoTyJPaXrszIU s+c1cJ19InHs4WP1/f9cmLhODy3l6V5+L8UZbcpMX+VowlU74VpiKdHLuWqfdNY2+Rwf 7vlLPc2L7YQfeA3btIS01ooEXtNukc451Nunad62w2eLMD5uJIrfBZ1eV+sDUJFYKasF ZbAw== X-Gm-Message-State: ABUngvcstxWuvKG0OHEyZLBeccXWwPMwhs0FZXMvqH3YdCV/ABtF19zJ3zNyRRnLQ4o0Uw== X-Received: by 10.98.223.203 with SMTP id d72mr15295435pfl.2.1478166509417; Thu, 03 Nov 2016 02:48:29 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id a22sm11215345pfg.7.2016.11.03.02.48.28 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Nov 2016 02:48:29 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi To: gdb-patches@sourceware.org Subject: [PATCH 06/11] Rename placed_size to kind Date: Thu, 3 Nov 2016 09:48:06 +0000 Message-Id: <1478166491-11357-7-git-send-email-yao.qi@linaro.org> In-Reply-To: <1478166491-11357-1-git-send-email-yao.qi@linaro.org> References: <1478166491-11357-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes This patch renames placed_size to kind. gdb: 2016-11-02 Yao Qi * breakpoint.h (struct bp_target_info) : Remove. : New field. Update all users. --- gdb/breakpoint.c | 4 ++-- gdb/breakpoint.h | 10 +++------- gdb/mem-break.c | 4 ++-- gdb/remote.c | 8 ++++---- 4 files changed, 11 insertions(+), 15 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index fcf73a5..9afbdbd 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -2770,7 +2770,7 @@ insert_bp_location (struct bp_location *bl, { int val; - bl->overlay_target_info.placed_size + bl->overlay_target_info.kind = breakpoint_kind (bl, &addr); bl->overlay_target_info.placed_address = addr; val = target_insert_breakpoint (bl->gdbarch, @@ -13126,7 +13126,7 @@ bkpt_insert_location (struct bp_location *bl) { CORE_ADDR addr = bl->target_info.reqstd_address; - bl->target_info.placed_size = breakpoint_kind (bl, &addr); + bl->target_info.kind = breakpoint_kind (bl, &addr); bl->target_info.placed_address = addr; if (bl->loc_type == bp_loc_hardware_breakpoint) diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h index aaff3d5..9bdc8ff 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -260,13 +260,9 @@ struct bp_target_info /* The length of the data cached in SHADOW_CONTENTS. */ int shadow_len; - /* The size of the placed breakpoint, according to - gdbarch_breakpoint_from_pc, when the breakpoint was inserted. - This is generally the same as SHADOW_LEN, unless we did not need - to read from the target to implement the memory breakpoint - (e.g. if a remote stub handled the details). We may still need - the size to remove the breakpoint safely. */ - int placed_size; + /* The breakpoint's kind. It is used in 'kind' parameter in Z + packets. */ + int kind; /* Vector of conditions the target should evaluate if it supports target-side breakpoint conditions. */ diff --git a/gdb/mem-break.c b/gdb/mem-break.c index dafe834..50f7d9c 100644 --- a/gdb/mem-break.c +++ b/gdb/mem-break.c @@ -44,7 +44,7 @@ default_memory_insert_breakpoint (struct gdbarch *gdbarch, int val; /* Determine appropriate breakpoint contents and size for this address. */ - bp = gdbarch_sw_breakpoint_from_kind (gdbarch, bp_tgt->placed_size, &bplen); + bp = gdbarch_sw_breakpoint_from_kind (gdbarch, bp_tgt->kind, &bplen); /* Save the memory contents in the shadow_contents buffer and then write the breakpoint instruction. */ @@ -76,7 +76,7 @@ default_memory_remove_breakpoint (struct gdbarch *gdbarch, { int bplen; - gdbarch_sw_breakpoint_from_kind (gdbarch, bp_tgt->placed_size, &bplen); + gdbarch_sw_breakpoint_from_kind (gdbarch, bp_tgt->kind, &bplen); return target_write_raw_memory (bp_tgt->placed_address, bp_tgt->shadow_contents, bplen); diff --git a/gdb/remote.c b/gdb/remote.c index c4f3947..cf960e5 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -9719,7 +9719,7 @@ remote_insert_breakpoint (struct target_ops *ops, *(p++) = ','; addr = (ULONGEST) remote_address_masked (addr); p += hexnumstr (p, addr); - xsnprintf (p, endbuf - p, ",%d", bp_tgt->placed_size); + xsnprintf (p, endbuf - p, ",%d", bp_tgt->kind); if (remote_supports_cond_breakpoints (ops)) remote_add_target_side_condition (gdbarch, bp_tgt, p, endbuf); @@ -9775,7 +9775,7 @@ remote_remove_breakpoint (struct target_ops *ops, addr = (ULONGEST) remote_address_masked (bp_tgt->placed_address); p += hexnumstr (p, addr); - xsnprintf (p, endbuf - p, ",%d", bp_tgt->placed_size); + xsnprintf (p, endbuf - p, ",%d", bp_tgt->kind); putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); @@ -10030,7 +10030,7 @@ remote_insert_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch, addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); - xsnprintf (p, endbuf - p, ",%x", bp_tgt->placed_size); + xsnprintf (p, endbuf - p, ",%x", bp_tgt->kind); if (remote_supports_cond_breakpoints (self)) remote_add_target_side_condition (gdbarch, bp_tgt, p, endbuf); @@ -10084,7 +10084,7 @@ remote_remove_hw_breakpoint (struct target_ops *self, struct gdbarch *gdbarch, addr = remote_address_masked (bp_tgt->placed_address); p += hexnumstr (p, (ULONGEST) addr); - xsnprintf (p, endbuf - p, ",%x", bp_tgt->placed_size); + xsnprintf (p, endbuf - p, ",%x", bp_tgt->kind); putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0);