From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73834 invoked by alias); 29 Apr 2016 14:48:25 -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 73791 invoked by uid 89); 29 Apr 2016 14:48:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=storing X-HELO: mail-pf0-f171.google.com Received: from mail-pf0-f171.google.com (HELO mail-pf0-f171.google.com) (209.85.192.171) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 29 Apr 2016 14:48:18 +0000 Received: by mail-pf0-f171.google.com with SMTP id 77so16403453pfv.2 for ; Fri, 29 Apr 2016 07:48:16 -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:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=1j3/mzXzOFmTuXeh1xaJvRSkw71G8HU9TguQP1R0CaY=; b=NnMJZmPRgTLSOLXJB9Bj9zQtEMm5eEiJUxNQLWUWXOoX89MIEvSC+023UvvWPtZEao bwNN1K4MSJKnKa2GfR4u9uKyqJCUSC+mwr0sH3JbMeGS962AbMXFpzlHMCQvYHkxreEP SdIKMdEFiq9Hcs3Y6JMj+ozj2x4mAGpIRxykunsZeLb8Jr8fNMxfvhi9AVBApepIys1Y puPcJAlh7xG3u195HDiUg8Vf6SbwnD5EKUB9IX0azKzOueezy1eDTt8J2IK7W6NI0B5Z rCmAOwLIGVINBnyPuLfH6R1bmX09cuWqcTjNKFgGjnfNrbyv1c8LTnNHbhV5tva9QtVg nBtQ== X-Gm-Message-State: AOPr4FVLv7G68vzG6LvyoqVqFizLdNT6hQhGabWl3Q2ZMMlGhPMnNuNbHNUfaffNNtJV0w== X-Received: by 10.98.19.131 with SMTP id 3mr29608989pft.17.1461941295149; Fri, 29 Apr 2016 07:48:15 -0700 (PDT) Received: from E107787-LIN (gcc1-power7.osuosl.org. [140.211.15.137]) by smtp.gmail.com with ESMTPSA id 199sm24060820pfc.15.2016.04.29.07.48.12 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Fri, 29 Apr 2016 07:48:14 -0700 (PDT) From: Yao Qi To: Pedro Alves Cc: Yao Qi , gdb-patches@sourceware.org Subject: Re: [PATCH 1/2] gdbarch software_single_step returns VEC (CORE_ADDR) * References: <1458742206-622-1-git-send-email-yao.qi@linaro.org> <1458742206-622-2-git-send-email-yao.qi@linaro.org> <56F2D1A2.80103@redhat.com> <86egasrr2a.fsf@gmail.com> Date: Fri, 29 Apr 2016 14:48:00 -0000 In-Reply-To: (Pedro Alves's message of "Wed, 27 Apr 2016 16:19:14 +0100") Message-ID: <86d1p8eajb.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00653.txt.bz2 Pedro Alves writes: > Another similar/related idea would be to go the gdbserver direction of > storing the breakpoint's "len/kind" in the breakpoint location, as a sepa= rate > field, instead of encoding it in the address: > > /* Return the breakpoint kind for this target based on PC. The PCPTR is > adjusted to the real memory location in case a flag (e.g., the Thumb= bit on > ARM) was present in the PC. */ > int (*breakpoint_kind_from_pc) (CORE_ADDR *pcptr); > > /* Return the software breakpoint from KIND. KIND can have target > specific meaning like the Z0 kind parameter. > SIZE is set to the software breakpoint's length in memory. */ > const gdb_byte *(*sw_breakpoint_from_kind) (int kind, int *size); > > > struct bp_target_info already has the "placed_size" field, > maybe we could reuse it, just like we started from the "len" > field on gdbserver, in 271652949894 (Support breakpoint kinds for=20 > software breakpoints in GDBServer). Yeah, I can give a try. > > In effect, this would move the gdbarch_remote_breakpoint_from_pc > calls to common code, just like it happened in gdbserver. > gdbarch_remote_breakpoint_from_pc will be no longer needed, because we've got "kind" field. We can use it when sending Z packet. > So when setting a single-step breakpoint, we'd get the "kind" > from the current mode, and when setting breakpoints from > user-input, we'd get it from the symbols tables / mapping symbols. This means we need this to get the "kind" from the current mode, /* Return the breakpoint kind for this target based on the current processor state (e.g. the current instruction mode on ARM) and the PC. The PCPTR is adjusted to the real memory location in case a flag (e.g., the Thumb bit on ARM) is present in the PC. */ int (*breakpoint_kind_from_current_state) (CORE_ADDR *pcptr); and also need to pass breakpoint location to to_insert_breakpoint to get the type of breakpoint we are inserting, right? --=20 Yao (=E9=BD=90=E5=B0=A7)