From nobody Sat Nov 23 23:41:25 2024 Received: from smtpfb1-g21.free.fr (smtpfb1-g21.free.fr [212.27.42.9]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4501A1E7C20 for ; Fri, 8 Nov 2024 13:46:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=212.27.42.9 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731073597; cv=none; b=KU92IGT5yzvAeBh6YgyD3jOg6uzwHgkTKAX0lTnrTPRGEIburzgReKv8m5Bz4NnUoUQGOZKNBYSKwwVcmLUyc2VDWh7IhhjHRk8xB1hmBbvNbQpO93gxIih4XzdOVGiq2LjQAU1W2caOkodJ4jbczcZZ21dZXQ3kBTHTC+PM5K4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731073597; c=relaxed/simple; bh=l81HqFooBgz0FksI+93rEVd1XWleW93EAvrWDtE1pu8=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=oLfXxKkdKzDlavgK6IqwzFL2yvuzctAXU+V6rx76Cmfb1cr2PjCabjGB3XLqVqXcrQqiWUur9bV40OKxrIjdmAeJHYrnYIv8ZGjiqn+1vPpOKlcRcGaEXsI3c44MdDiorLFDzyBY47nAK2N7jBzHUFzN0d0JdHMeFfvuG6/SBpU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=free.fr; spf=pass smtp.mailfrom=free.fr; arc=none smtp.client-ip=212.27.42.9 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=free.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=free.fr Received: from smtp2-g21.free.fr (smtp2-g21.free.fr [212.27.42.2]) by smtpfb1-g21.free.fr (Postfix) with ESMTP id 8E271DF91B0 for ; Fri, 8 Nov 2024 14:41:06 +0100 (CET) Received: from localhost (unknown [82.64.135.138]) by smtp2-g21.free.fr (Postfix) with ESMTP id 5E1252003AE; Fri, 8 Nov 2024 14:40:53 +0100 (CET) Received: by localhost (Postfix, from userid 1000) id 46A9F40042; Fri, 08 Nov 2024 14:39:09 +0100 (CET) Date: Fri, 8 Nov 2024 14:39:09 +0100 From: Etienne Buira To: Jan Kiszka , Kieran Bingham , Etienne Buira , Andrew Morton , Andrew Ballance , linux-kernel@vger.kernel.org Subject: [PATCH] gdb: lx-symbols: do not error out on monolithic build Message-ID: Mail-Followup-To: Jan Kiszka , Kieran Bingham , Etienne Buira , Andrew Morton , Andrew Ballance , linux-kernel@vger.kernel.org Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This avoids spurious message: (gdb) lx-symbols loading vmlinux No source file named kernel/module/main.c. Signed-off-by: Etienne Buira --- scripts/gdb/linux/modules.py | 3 +++ scripts/gdb/linux/symbols.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/gdb/linux/modules.py b/scripts/gdb/linux/modules.py index 298dfcc25eae..fa15f872ddbe 100644 --- a/scripts/gdb/linux/modules.py +++ b/scripts/gdb/linux/modules.py @@ -19,6 +19,9 @@ from linux import cpus, utils, lists, constants module_type =3D utils.CachedType("struct module") =20 =20 +def has_modules(): + return utils.gdb_eval_or_none("modules") is not None + def module_list(): global module_type modules =3D utils.gdb_eval_or_none("modules") diff --git a/scripts/gdb/linux/symbols.py b/scripts/gdb/linux/symbols.py index e8316beb17a7..fb0f55d81686 100644 --- a/scripts/gdb/linux/symbols.py +++ b/scripts/gdb/linux/symbols.py @@ -178,13 +178,13 @@ lx-symbols command.""" =20 self.load_all_symbols() =20 - if hasattr(gdb, 'Breakpoint'): + if hasattr(gdb, 'Breakpoint') and modules.has_modules(): if self.breakpoint is not None: self.breakpoint.delete() self.breakpoint =3D None self.breakpoint =3D LoadModuleBreakpoint( "kernel/module/main.c:do_init_module", self) - else: + elif modules.has_modules(): gdb.write("Note: symbol update on module loading not supported= " "with this gdb version\n") =20 --=20 2.45.2