From patchwork Wed May 3 09:12:25 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: 678822 Delivered-To: patch@linaro.org Received: by 2002:a5d:4a41:0:0:0:0:0 with SMTP id v1csp947671wrs; Wed, 3 May 2023 02:17:26 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5cIiv1NGCYRpBphuCsGQGDq5/G8syghWUR3hhb7KqYE30zh3C1dSjy6HjQYbBKFY3KHNtq X-Received: by 2002:a05:6214:234a:b0:56a:b623:9b09 with SMTP id hu10-20020a056214234a00b0056ab6239b09mr7785257qvb.14.1683105445883; Wed, 03 May 2023 02:17:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683105445; cv=none; d=google.com; s=arc-20160816; b=LUUh6zN9a1To0OprUPLTGsGs4hWWUFh8c+YUJs934DAy8uy043k33gvjkdmFt9Y7CF fjpt3JyPQsRndRIHOmQPg4uS4oM4QccXKgfotRRAKYnS9mwc8bmQrRq346sRtX7L8m3a cUW6nEABn+zfCHEkVGqjUOT7kjx84zKCdCHX65IjGdNh2hy46tL9BBkuvVBbifPDaNsn J3wpCjnvtQFOcRo9FqFvjiWSZx1ZOwa8J7mM0IPJA6M5o/4gYDLtBpm798feGV4pIE+m aF9z5i+jLBK1illNLs8lV/ZperdFHh+E/CEOHXNqT21KNz0+j5xWQ2RyUU3Y+bq1T1sd qWng== 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=C3lCzFefD4c64bE6al6V8o2voUIucp9QMyCoP1My2wo=; b=ml+EM1B6dr/YOz+KIcWntp7Qohvk6sOiDMAwVwFEIaesK9NlIQtF67s1/YlvG4MeL2 hx3lOS8kx0//CeZiWpmh1IrOYpD+5us2YlZF0oxOuft71SlrSrL5LPVu7lzHFeLJ2BN4 h8mZhaJ3Su/DjpiWRjOPGxXALlBE/YRkWbEC3tuWjMX1VEfVhLVNtZW2ZBkKtnNEFz8p crA6DlJI6TugcBQX5+LeqFfvjLzaj+Mk+MBbxw0l1z+GDuP0CbRZQ83YKpEQ6KDkCWWZ NhKwrm9yg9/KPO8RrMyLDUdtyGZIt+G9w/71BQEBwJDuHnwXtC4U0RX9+29dz83rqru7 DFYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m7P95diA; 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 g13-20020a0562141ccd00b005ef54f89331si17983532qvd.267.2023.05.03.02.17.25 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 May 2023 02:17:25 -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=m7P95diA; 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 1pu8Xm-0004Ee-01; Wed, 03 May 2023 05:13:02 -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 1pu8Xh-0003qY-An for qemu-devel@nongnu.org; Wed, 03 May 2023 05:12:57 -0400 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pu8XZ-0005rN-UZ for qemu-devel@nongnu.org; Wed, 03 May 2023 05:12:57 -0400 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-3f315735514so14865255e9.1 for ; Wed, 03 May 2023 02:12:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683105167; x=1685697167; 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=C3lCzFefD4c64bE6al6V8o2voUIucp9QMyCoP1My2wo=; b=m7P95diAKx3RwvY3MuY2qjVhwOX2cjDmTCnpmWwXekQzMWds6JYZ/sJ5aWh90KS48t /VtT4T/Iq4b0F6IzXrQJlYMjoY7EvtHoNd6NggvNAxiQ44Ebz96ZzeglRiermpLjiC0/ G6E2gD8yjBItzgBph8q7RMgT1nEFn6mRzTY4a1pREC/6nW8V/Gz6/QnvqSkxGMxMXT/K LQIGKpyhoyKpW8Vmfg2xH9wSnBqC15Xg0AXEmhrQPqlawu2avVsj7+PTazwFu+6E2mqR 97L67oP1eAnbseDrn0hre7hu/wiashOtWi4DWrogwMOlZMQPzAs2FbD7vRfxxrBKSu/5 v3QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683105167; x=1685697167; 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=C3lCzFefD4c64bE6al6V8o2voUIucp9QMyCoP1My2wo=; b=es+BCUb1Na6lPwJyGDCOPpDkRNIk8kBX9MCi69iFBFb5LV/bMSif+axK5qmNAVFYte CYy+FgnXmUSGLfzFvGNbWuV0h9qWjNptIbFzB7WVxJJvZ2t43NE5rbMsMhtei4d0PrRg kHdHJGchifVo0goYtnyQE+OEyIBarNk1zI5uTzjIpMXD29ESc+ltC4jyrPMlps9fGP2u vRL+gpwD8EhmF5bs1I2nzmDOoKE/7fs4JCZTcvJJPItBJK4IKhTSLLwZHPBh0kyyt8VA Isv4XquTor/N+qyDznNBXE5Io1uw9/ohn2TvsMw5P+ufQJ1L+1y0DkVgERr5hOclD5tC 2x5Q== X-Gm-Message-State: AC+VfDzwl8EmzIGVAa9pnzCwuC0NGjPY1zssO7XFtpmSXE7n9GCPYJ8+ /Yl8EF+pzpXm4Z6NBXUEbR3d/g== X-Received: by 2002:a5d:570d:0:b0:2f0:583:44be with SMTP id a13-20020a5d570d000000b002f0058344bemr1019811wrv.0.1683105167267; Wed, 03 May 2023 02:12:47 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id k9-20020a5d6e89000000b0030629536e64sm9382356wrz.30.2023.05.03.02.12.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 May 2023 02:12:46 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5784A1FFBD; Wed, 3 May 2023 10:12:45 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Laurent Vivier , Artyom Tarasenko , "Edgar E. Iglesias" , Wainer dos Santos Moschetta , Thomas Huth , Leif Lindholm , Paolo Bonzini , Gerd Hoffmann , Helge Deller , Xiaojuan Yang , Stefan Hajnoczi , Cleber Rosa , Peter Maydell , Eduardo Habkost , Juan Quintela , John Snow , Yoshinori Sato , =?utf-8?q?C=C3=A9dric_Le_Goater?= , Ilya Leoshkevich , Pavel Dovgalyuk , Andrew Jeffery , qemu-s390x@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , qemu-arm@nongnu.org, Bastian Koppelmann , Beraldo Leal , Max Filippov , =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Mark Cave-Ayland , Jiaxun Yang , Radoslaw Biernacki , Aurelien Jarno , David Hildenbrand , Markus Armbruster , Song Gao , Joel Stanley , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Phil?= =?utf-8?q?ippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 03/22] docs: document breakpoint and watchpoint support Date: Wed, 3 May 2023 10:12:25 +0100 Message-Id: <20230503091244.1450613-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230503091244.1450613-1-alex.bennee@linaro.org> References: <20230503091244.1450613-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x331.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=unavailable 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. Signed-off-by: Alex Bennée Reviewed-by: Juan Quintela --- docs/system/gdb.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 ============================