lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <154d13e3-f80c-46a3-8682-ab894c3d8f90@siemens.com>
Date: Fri, 8 Nov 2024 15:46:15 +0100
From: Jan Kiszka <jan.kiszka@...mens.com>
To: Kieran Bingham <kbingham@...nel.org>,
 Etienne Buira <etienne.buira@...e.fr>,
 Andrew Morton <akpm@...ux-foundation.org>,
 Andrew Ballance <andrewjballance@...il.com>, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] gdb: lx-symbols: do not error out on monolithic build

On 08.11.24 14:39, Etienne Buira wrote:
> This avoids spurious message:
> (gdb) lx-symbols
> loading vmlinux
> No source file named kernel/module/main.c.
> 
> Signed-off-by: Etienne Buira <etienne.buira@...e.fr>
> ---
>  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 = utils.CachedType("struct module")
>  
>  
> +def has_modules():
> +    return utils.gdb_eval_or_none("modules") is not None
> +
>  def module_list():
>      global module_type
>      modules = 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."""
>  
>          self.load_all_symbols()
>  

if not modules.has_modules():
   return

> -        if hasattr(gdb, 'Breakpoint'):
> +        if hasattr(gdb, 'Breakpoint') and modules.has_modules():
>              if self.breakpoint is not None:
>                  self.breakpoint.delete()
>                  self.breakpoint = None
>              self.breakpoint = 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")
>  

Looks good otherwise.

Jan

-- 
Siemens AG, Technology
Linux Expert Center

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ