From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1061FC07E9B for ; Wed, 21 Jul 2021 10:09:15 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D69B611CE for ; Wed, 21 Jul 2021 10:09:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7D69B611CE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:47266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m69A9-0003rw-IQ for qemu-devel@archiver.kernel.org; Wed, 21 Jul 2021 06:09:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47690) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m6942-0006Z0-QY for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:02:54 -0400 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:35602) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m6941-0008IS-5T for qemu-devel@nongnu.org; Wed, 21 Jul 2021 06:02:54 -0400 Received: by mail-wr1-x42e.google.com with SMTP id m2so1545207wrq.2 for ; Wed, 21 Jul 2021 03:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=qE/1+W+Jp+TK7m9gMN6V6r4zcQHB8cmAWo3GF1T5o6E=; b=scI40cL7RUMYdGJGJjH8ar87qCKTLDLMGbs/Gh6ixZtDMGebr2An3tMp+s9d3VUMSM wZ1aF590jwEZnVbcfcAag7w6PTfZv89hQQ/JwzasGUr/mk1z9kBxTaocvA8td2L2oQSs PzJSmdUszsEMEtrFZngttvw41DSCGVYYia7HGWAyp35D7QhpuFoU9ZPRZ/ruEFfuw10m wLeHCtjETyrmOmOx6qVhxmPn1B9nnrzhZpa2RaJESWC9HhY1LBy55tK9DQHB7nL6/8t8 +n9jIOMt3t3b2ll7uM/BPDf92AfjthAJmwksZDSjyb4e2irgbZzZJ22cj077m0VJjy4f 6ZDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=qE/1+W+Jp+TK7m9gMN6V6r4zcQHB8cmAWo3GF1T5o6E=; b=LWXWBmhM0VLkC0B67hbjJ/HFvyURQPor8eEv0XkbWGyaA1BPP1TnBIhmPdF0fW5ghZ Nhkr51GB36xTPA2O/o2kmDUrqmY0Bja6Xc1mXr2+rPjN0ciGISSOlbgFhVnWthAWL7dk R4mLxDNmS8sqyr/8It8yzGQgpTMDpRx8wgIzSg+0JmDHCEaznVmBvFSdlwgrco1O0DSJ WgB9if5C2Rpa08YJBXAapJ7gBZr5bgewU2sw4aY8hfINkCna8cmXy+nahuyUboJhfQQc VACI9ZzOrnv0kTBxJAyJOBIUMBf/XGmoWcNInvLDqimw+qUkCcJe0RAC9YIC+DG6+Th3 jk3Q== X-Gm-Message-State: AOAM531BatucJFQQ0E9e5DO2qqaCWkt22OmYD1rH94qaqSJgZgyrHwFA yapZu96al7r7tMEz/J/g51O2Ig== X-Google-Smtp-Source: ABdhPJyfcfFm8FWTyTmsAAMS51pPcP9/FR5FgrlR+qsSsr/yu2JIjqL+3Q4vIsHHnqMXIIWugLZW8Q== X-Received: by 2002:adf:d1cf:: with SMTP id b15mr41531894wrd.93.1626861770947; Wed, 21 Jul 2021 03:02:50 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t5sm26623108wrw.38.2021.07.21.03.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jul 2021 03:02:49 -0700 (PDT) Received: from zen (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id E893E1FF7E; Wed, 21 Jul 2021 11:02:48 +0100 (BST) References: <20210720195439.626594-1-richard.henderson@linaro.org> <20210720195439.626594-12-richard.henderson@linaro.org> <6e101005-ce67-3179-b446-c9b963b6bda2@linaro.org> <2a1b3fb7-e701-f2a6-0777-caa90a9e3a51@amsat.org> <7f5d1a72-4a50-b9dc-6300-6d3d7698415b@amsat.org> User-agent: mu4e 1.5.14; emacs 28.0.50 From: Alex =?utf-8?Q?Benn=C3=A9e?= To: Philippe =?utf-8?Q?Mathieu-Daud=C3=A9?= Subject: Re: [PATCH for-6.1 v6 11/17] hw/core: Introduce CPUClass.gdb_adjust_breakpoint Date: Wed, 21 Jul 2021 10:56:24 +0100 In-reply-to: <7f5d1a72-4a50-b9dc-6300-6d3d7698415b@amsat.org> Message-ID: <87h7gokmrb.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Mark Cave-Ayland , Richard Henderson , QEMU Developers , Michael Rolnik Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Philippe Mathieu-Daud=C3=A9 writes: > On 7/20/21 11:53 PM, Philippe Mathieu-Daud=C3=A9 wrote: >> On 7/20/21 11:08 PM, Richard Henderson wrote: >>> On 7/20/21 10:56 AM, Peter Maydell wrote: >>>> On Tue, 20 Jul 2021 at 20:54, Richard Henderson >>>> wrote: >>>>> >>>>> This will allow a breakpoint hack to move out of AVR's translator. >>>>> >>>>> Signed-off-by: Richard Henderson >>>> >>>> So previously for AVR we would have considered the bp at 0x100 >>>> and the one at 0x800100 as distinct (in the sense that the only way >>>> the gdb remote protocol distinguishes breakpoints is by "what address", >>>> and these have different addresses). After this change, they won't >>>> be distinct, because if you set a bp at 0x100 and 0x800100 and then >>>> try to remove the one at 0x100 we might remove the 0x800100 one, >>>> because we're storing only the adjusted-address, not the one gdb used. > > Yes. Looks good. > >>>> >>>> This might not matter in practice... >>> >>> I don't think it will matter. >>> >>> Currently, if it sets both 0x100 and 0x800100, then we'll record two >>> breakpoints, and with either we'll raise EXCP_DEBUG when pc =3D=3D 0x10= 0. >>> >>> Afterward, we'll have two CPUBreakpoint structures that both contain >>> 0x100, and when pc =3D=3D 0x100 we'll raise EXCP_DEBUG.=C2=A0 If gdb re= moves the >>> breakpoint at 0x800100, we'll remove one of the two CPUBreakpoint.=C2= =A0 But >>> we'll still stop at 0x100, as expected.=C2=A0 When it removes the break= point >>> at 0x100, both CPUBreakpoint structures will be gone. >>> >>> In principal, gdb could now add a breakpoint at 0x800100 and remove it >>> with 0x100, where it could not before.=C2=A0 But I don't expect that to >>> happen.=C2=A0 If we reported any kind of status to gdb re the breakpoint >>> insertion or removal (e.g. bp not found), then it might matter, but we >>> don't. > > IIUC QEMU model is "hardware breakpoint". I don't know how gdb deals > if user add both soft/hard bp. Neither do I know how many soft/hard > bp are "annouced" via gdbstub monitor to gdb (Alex?). The gdbstub treats both the same and I don't think gdb cares about the limit until we tell it we can't insert a breakpoint (which we won't because breakpoints are infinite). --=20 Alex Benn=C3=A9e