From patchwork Wed May 14 12:57:44 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 889878 Delivered-To: patch@linaro.org Received: by 2002:adf:fd8a:0:b0:3a1:f579:ae88 with SMTP id d10csp2618701wrr; Wed, 14 May 2025 06:20:28 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV4Bm4Luxj/N6VDZe7Qm9Z748YWoD4D/llzGvuXZiQ/DVIEsB3f6nirPohlmTKgCjQhaTSHCQ==@linaro.org X-Google-Smtp-Source: AGHT+IHSq2Jj4mIfYovCGU2vClFGQGUuLd+rgo0bnLMHssLsWDQkWl/MEqSg+zmsl8rD/ihDOC5u X-Received: by 2002:a05:620a:45a5:b0:7c3:d711:6ffb with SMTP id af79cd13be357-7cd2887804dmr528393485a.41.1747228827741; Wed, 14 May 2025 06:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747228827; cv=none; d=google.com; s=arc-20240605; b=YM3tVLwNzeAoOFHzQZU3UDX8oxmKT96XUB3eV9CyFAq/x3tgeO8HN8RctkArUFD+eJ PT3+Ti+OlyhjkEMRXbJCDv7T57LROCtdJkrxz3FldbAoL2PckF2B5nuzcgLP73wis4WG lWXp5o6ShIAFORTlsIuenlPh1YuvAE9xJObpcb4vCZBUSldaJEjm9z+w+wWlzhCHCzyR /8em1rJp29B6rc+WFojpAaTJw2yIG2cc9LoemXzFyDH2jy5RjE99+O9H8SunxYDMezTW TTT8Xn8t1YysF4moEV9d8ALnAoy2Vdy8V231dCJHMKzxX5jt9mPIWKMTK1GG7CTIBl42 gUuA== 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=QGSSxTVTvIadJfnRlVmW90dgW15MiLs8beOcvM12YVw=; fh=oWLcPJxnKq4dSYKEL252oFvFAim14Gy59aQ+WFb//EY=; b=fFiwzXuZAqZdLrHXfluCD/w5QlD1sD2IguHFZgm26yTaib0conB7M9XTMJDHKVCKl9 3iJcL1USHi1ellGZn0LV41aWnFc+SZVY+/t3WlQqIOiK2geGGuZz6bb3SKJHpMmx+cqe TZMAO9Fv1ZAsi/8J4LTK7MNjJffWlJp+kufz3amPoAgSzcUXCwzJxKSnKgH9gHKqKO3i UzwV6Ple0G7mkGcjr+0QTnevd5tKJz1DbqOXeGrwybizIQSku+XhOF2Anbmx/HADoXyM G3SjR2p4GvnYEN9UN5kp6HnkB/8i1dDBgb6VYXUW95U2fAkUQqsEFNxEtQnjaUS6Vq6/ eJHQ==; 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 af79cd13be357-7cd00fd4be7si1408512985a.308.2025.05.14.06.20.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 May 2025 06:20:27 -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 1uFBn9-0003x2-3S; Wed, 14 May 2025 09:04:59 -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 1uFBj7-0007Xy-Uw; Wed, 14 May 2025 09:00:59 -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 1uFBiy-0008Cv-UJ; Wed, 14 May 2025 09:00:44 -0400 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 29158121AF4; Wed, 14 May 2025 15:57:50 +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 C822E20B862; Wed, 14 May 2025 15:57:59 +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-9.2.4 22/34] hw/core/cpu: gdb_arch_name string should not be freed Date: Wed, 14 May 2025 15:57:44 +0300 Message-Id: <20250514125758.92030-22-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 c3ca0babcb..0e4d6f1c98 100644 --- a/include/hw/core/cpu.h +++ b/include/hw/core/cpu.h @@ -134,7 +134,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.