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: 13229932 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C5A87C77B7F for ; Wed, 3 May 2023 09:17:25 +0000 (UTC) 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-Google-Smtp-Source: ACHHUZ72bqVLp/pk0XQ+2u8vFz9zKhcNYWfQgzNYkagXKxWa+INexrxTEG0y8GItt14E5AtLeNlu8A== 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+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.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 ============================