From patchwork Wed May 14 19:00:18 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 889882 Delivered-To: patch@linaro.org Received: by 2002:adf:fd8a:0:b0:3a1:f579:ae88 with SMTP id d10csp2782065wrr; Wed, 14 May 2025 12:03:33 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWZV8cLE7BkFp5XO+kTe1ujEjBUwlLmDQg5xOvhTbohhZFgK5Mcxku2fk/wGlV5b+VhXTNG3A==@linaro.org X-Google-Smtp-Source: AGHT+IHKqQ49G1XvZ3Tuwfa3O3tCIhQX/hXVmOZALIRNWUZ6SyaZpTsEIIe0eeKxMqTzw3msHCpV X-Received: by 2002:ac8:6f0d:0:b0:476:7e6b:d291 with SMTP id d75a77b69052e-49495cdad8cmr75074711cf.37.1747249412986; Wed, 14 May 2025 12:03:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747249412; cv=none; d=google.com; s=arc-20240605; b=ap3QAIlhkXgplmt5Kwei5uog8/gPKPGMKRDk31ZgkQPuIWAnI06ToyLc2RkJWDgOHI zYnhAW2u3KF6wSdpEJuNoc0nm50SlcFN1nW3i09V+Qr0rq/HNYnJ8MpZR4dpXLdsfxB4 QVXdt6u3K1awDBruSi7RsG87KwobnFs5Ccos+CpcLlG4g7aB9Vafmf+5YqkWrw5ZFOPV 9AkIiDBzjVhyrvmZF4tUwp216Y+JaNKcKVxmxpCaAM6Dguhh2igDyNfLepqnc89d3skS aBQhNZxQNB7trmY918PdyOYkD4Uln5Bm9eJ2Xn55ozGkv1FuEpGxmfmU9HFg1pl5++pa dd8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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; bh=+a67s4ku/+SPKFfdCqdmotpOqxrjkoeqEePXP17ix+E=; fh=oWLcPJxnKq4dSYKEL252oFvFAim14Gy59aQ+WFb//EY=; b=NuNcRhdEoRmA+DgJ+J27ITsw0mm+PrGUJzD+Ml/XWDnE0LdB8H/RMLbdSp8bDDi105 Y9zLyQQpNqgPut5MOA2Mubpl1qZYVaKhqO72X9fOYnjuug57xzjRhPYlHUJ029hu5mwW E0MoYo3MoYp9uZX4b0mog6rRcEJ2MzxBk3PjXfAnxyX8rYp5CthT5msBjx/ZN/G6whG4 TMkDtEaoBDtXJTgvcWGQtadihJ8SoH+CYok2ft68lvf2HhzZ6bLPiwnFvHCjPnr906Co Wg4JONrIby/T2Ogpy2Y/t/JwAmdRQWqaHul6NNQ6rjzncutZR/RAqc7stKbU9SiKCZMd xXng==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d75a77b69052e-4945257e96dsi139554081cf.372.2025.05.14.12.03.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 May 2025 12:03:32 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uFHNu-0007vc-RN; Wed, 14 May 2025 15:03:19 -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 1uFHLj-0004Jv-AM; Wed, 14 May 2025 15:01:03 -0400 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uFHLf-0007LE-QR; Wed, 14 May 2025 15:01:02 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 3ACA6121D90; Wed, 14 May 2025 22:00:32 +0300 (MSK) Received: from think4mjt.tls.msk.ru (mjtthink.wg.tls.msk.ru [192.168.177.146]) by tsrv.corpit.ru (Postfix) with ESMTP id 3E70D20BA82; Wed, 14 May 2025 22:00:42 +0300 (MSK) From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , =?utf-8?q?Philippe_M?= =?utf-8?q?athieu-Daud=C3=A9?= , Michael Tokarev Subject: [Stable-10.0.1 06/23] hw/core/cpu: gdb_arch_name string should not be freed Date: Wed, 14 May 2025 22:00:18 +0300 Message-Id: <20250514190041.104759-6-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, 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.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 From: Peter Maydell The documentation for the CPUClass::gdb_arch_name method claims that the returned string should be freed with g_free(). This is not correct: in commit a650683871ba728 we changed this method to instead return a simple constant string, but forgot to update the documentation. Make the documentation match the new semantics. Fixes: a650683871ba728 ("hw/core/cpu: Return static value with gdb_arch_name()") Signed-off-by: Peter Maydell Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Message-ID: <20250317142819.900029-2-peter.maydell@linaro.org> Signed-off-by: Philippe Mathieu-Daudé (cherry picked from commit 56a9f0d4c4a483ce217e5290db69cb1788586787) Signed-off-by: Michael Tokarev diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h index abd8764e83..e136b067cd 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -135,7 +135,8 @@ struct SysemuCPUOps; * @gdb_stop_before_watchpoint: Indicates whether GDB expects the CPU to stop * before the insn which triggers a watchpoint rather than after it. * @gdb_arch_name: Optional callback that returns the architecture name known - * to GDB. The caller must free the returned string with g_free. + * to GDB. The returned value is expected to be a simple constant string: + * the caller will not g_free() it. * @disas_set_info: Setup architecture specific components of disassembly info * @adjust_watchpoint_address: Perform a target-specific adjustment to an * address before attempting to match it against watchpoints.