From patchwork Wed May 10 15:06:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 680514 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp2897663wrs; Wed, 10 May 2023 08:08:23 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6vzvUp/RIr8xnYb2qhi3+hVFqctRuNzQdSRcJdhBbuMLV73oDSu2CmuT2ZroqYJ8q1kMJK X-Received: by 2002:a05:7500:1825:b0:105:8534:6582 with SMTP id ci37-20020a057500182500b0010585346582mr611060gab.10.1683731303490; Wed, 10 May 2023 08:08:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683731303; cv=none; d=google.com; s=arc-20160816; b=miSN2DavB/qmsJBMbWdEuiEeOfgvVMNfALRUukH0PvpC4kS/H50ovb6T85VLflxsLd mcB3stgA/FkUYGOXmlTCXf/9g6ehkrkKnJNHz5L+r1xfMj49wxpwlUS0Q6BvuDY7uAfl jpSja/mRCV7CaRPJEp53qE6TvJdCX3Ai0mKYEuVxfkeND/hnP9LqZ2ijK4PFT9uIeFBj Ky+L0bKuCupj0fszKRmayj/j1c/cwLwr6oMMTfcuMqMYY3NyOesTg2L1323tLdwWl0r2 NNQvkj9m0rI6nHwIsMKwi0/WvShKG6ifS+56DzRknswaGeSHjqPIFSCBh6Gnoej0OYYn V5Zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0hip+YGE5pxFrA4N2S9fipS+cB+XrCAPV4NMoBvIAnw=; b=TlGeOliCfmAQ2Ri73FwypspuoTlXRV7iL4yZdKQtljAoPMPvyJygjH/zaZ59G8TVO3 JXI+oorI4UE+HnF70Ig1ETjGJg1DnqtFfjv283CjhGhT0IhLj3iwLz9GfwYBjsVp3/Ea xjxVQ8RygNzpYekiDPpLZXl7SMSGFhgiQqTigE5Hwkgq9L2jiKCKEsWPFI1lrgZmPPvr a6D5ymv9A0llA5wuakEBJPLv6TN0ispiG/9iAQmEDqxaqb79RqndDcxIeDUGTzZevBM6 irkeb6UzjTbO7eN5hG5dQsxfzHorek0PwS/O77GHKkY/lVqUISPhmTXU/XHMgcsVNsng FHpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HbWW3eV4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id w1-20020a05620a128100b0071adfd3610csi5048637qki.719.2023.05.10.08.08.23 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 May 2023 08:08:23 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HbWW3eV4; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pwlPF-0006sz-N4; Wed, 10 May 2023 11:07:05 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pwlPE-0006rM-46 for qemu-devel@nongnu.org; Wed, 10 May 2023 11:07:04 -0400 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pwlPB-0001Vb-HY for qemu-devel@nongnu.org; Wed, 10 May 2023 11:07:03 -0400 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-3f315712406so251112255e9.0 for ; Wed, 10 May 2023 08:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683731220; x=1686323220; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0hip+YGE5pxFrA4N2S9fipS+cB+XrCAPV4NMoBvIAnw=; b=HbWW3eV4bmsvXJxTyYVr7SmhdeAo2LcDE30/sXdotGKWG6hqVwSg5JmR8ITfjKf/Ho dTE9NGUSfK7Vw4dXba2mbjuhd/Lz5e2xtCBtJMtn9iY9xg6tlGK6uzR1SWtGseqVouME WKiJ2k51jGEDKRk/31n3UHR3a/Ty4HpPa/2+NzQHEfdN2zXR3jVn0IXu4d2M3JppmNAt xnbZWACy5+xQcFPgiANvoSLHqNlnkQ3r241YmI87XQ8Z1mKHDY5vMizP/j7xbZwPJxUU HmRi50ZiIfKjJrEdcHky3CPPeI8g6Hd5vDJbtRKhpnmwpjILZF8QQ5JlHDG8GcwlP0rL dZkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683731220; x=1686323220; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0hip+YGE5pxFrA4N2S9fipS+cB+XrCAPV4NMoBvIAnw=; b=JgEHgtopNuOF0eZDF3uWu/eNRJvQ6QyDIOA5ft17nOXPE/GNi7KHZfLVd2vvqacW/4 FXJmeAhEKJaxbq2xI9/AUSbBPrvMfgxb90GZ3gtt6Qunh/7NKGXZbKhoAGElB2720Nrj BtGjSB/a2jgt4ymRPSfPm80NK8wT/VeE2emomqcD/IQs6tSkdJSVxxRNTJORaI1jOro/ G0CVZ5cBhdI+xu7kPKtrONJYTiq86Aav2jCZ3c50quTHitcKrO4GK5V47F3k4r5/YBeR V7wTDfNI09eaUNw5eGsdzcfC/gjIMDLvLVe1gw62KlZRgZ7Oq2zZS7JXs8n5rcXUD/qU ZO+A== X-Gm-Message-State: AC+VfDy4RrGOsci00S64dUoEgfI1226M8nRLqJplKdbOwtBNa0lw3zb1 p+XnDZUf3Ci25k5TUcmyFrJlHA== X-Received: by 2002:adf:e948:0:b0:306:2c20:c4fb with SMTP id m8-20020adfe948000000b003062c20c4fbmr17446831wrn.2.1683731219922; Wed, 10 May 2023 08:06:59 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id r15-20020a5d694f000000b00306415ac69asm17588677wrw.15.2023.05.10.08.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 May 2023 08:06:59 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D8BA01FFBD; Wed, 10 May 2023 16:06:58 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: richard.henderson@linaro.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Juan Quintela , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PULL 2/8] docs: document breakpoint and watchpoint support Date: Wed, 10 May 2023 16:06:52 +0100 Message-Id: <20230510150658.1399087-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230510150658.1399087-1-alex.bennee@linaro.org> References: <20230510150658.1399087-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32f.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This varies by accelerator. Also mention the modern bear trap that is ASLR. Message-Id: <20230503091244.1450613-4-alex.bennee@linaro.org> Reviewed-by: Juan Quintela Signed-off-by: Alex Bennée diff --git a/docs/system/gdb.rst b/docs/system/gdb.rst index 453eb73f6c..7d3718deef 100644 --- a/docs/system/gdb.rst +++ b/docs/system/gdb.rst @@ -46,6 +46,28 @@ Here are some useful tips in order to use gdb on system code: 3. Use ``set architecture i8086`` to dump 16 bit code. Then use ``x/10i $cs*16+$eip`` to dump the code at the PC position. +Breakpoint and Watchpoint support +================================= + +While GDB can always fall back to inserting breakpoints into memory +(if writable) other features are very much dependent on support of the +accelerator. For TCG system emulation we advertise an infinite number +of hardware assisted breakpoints and watchpoints. For other +accelerators it will depend on if support has been added (see +supports_guest_debug and related hooks in AccelOpsClass). + +As TCG cannot track all memory accesses in user-mode there is no +support for watchpoints. + +Relocating code +--------------- + +On modern kernels confusion can be caused by code being relocated by +features such as address space layout randomisation. To avoid +confusion when debugging such things you either need to update gdb's +view of where things are in memory or perhaps more trivially disable +ASLR when booting the system. + Debugging multicore machines ============================