Skip to content

Commit c416aee

Browse files
iostapyshynakpm00
authored andcommitted
scripts/gdb: mm: cast untyped symbols in x86_page_ops
The symbols phys_base, _text, and _end, used in x86_page_ops are either defined in assembly or implicitly by the linker. Thus, they lack type information and cause a conversion error after gdb.parse_and_eval. Explicitly cast these expressions to unsigned long. Link: https://lore.kernel.org/20260427142448.666117-2-illia@yshyn.com Fixes: 55f8b45 ("scripts/gdb: implement x86_page_ops in mm.py") Signed-off-by: Illia Ostapyshyn <illia@yshyn.com> Cc: Florian Fainelli <florian.fainelli@broadcom.com> Cc: Jan Kiszka <jan.kiszka@siemens.com> Cc: Kieran Bingham <kbingham@kernel.org> Cc: Vlastimil Babka <vbabka@suse.com> Cc: Hao Li <hao.li@linux.dev> Cc: Harry Yoo <harry@kernel.org> Cc: Seongjun Hong <hsj0512@snu.ac.kr> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 620072f commit c416aee

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

scripts/gdb/linux/mm.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ def __init__(self):
4040

4141
self.PAGE_OFFSET = int(gdb.parse_and_eval("page_offset_base"))
4242
self.VMEMMAP_START = int(gdb.parse_and_eval("vmemmap_base"))
43-
self.PHYS_BASE = int(gdb.parse_and_eval("phys_base"))
43+
self.PHYS_BASE = int(gdb.parse_and_eval("(unsigned long) phys_base"))
4444
self.START_KERNEL_map = 0xffffffff80000000
4545

46-
self.KERNEL_START = gdb.parse_and_eval("_text")
47-
self.KERNEL_END = gdb.parse_and_eval("_end")
46+
self.KERNEL_START = gdb.parse_and_eval("(unsigned long) &_text")
47+
self.KERNEL_END = gdb.parse_and_eval("(unsigned long) &_end")
4848

4949
self.VMALLOC_START = int(gdb.parse_and_eval("vmalloc_base"))
5050
if self.VMALLOC_START == 0xffffc90000000000:

0 commit comments

Comments
 (0)