qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unable to access init.text section of the Linux Kernel when debuggin


From: Alex Bennée
Subject: Re: Unable to access init.text section of the Linux Kernel when debugging with GDB using kvm
Date: Mon, 04 Jul 2022 12:34:07 +0100
User-agent: mu4e 1.7.27; emacs 28.1.90

Dmitrii Bundin <dmitrii.bundin.a@gmail.com> writes:

> When debugging Linux Kernel running in QEMU with GDB it's not possible to 
> access the Kernel function located in .text.init. Example:
>
> (gdb) disas start_kernel
> Dump of assembler code for function start_kernel:
>    0xffffffff83160ff3 <+0>:     Cannot access memory at address 
> 0xffffffff83160ff3
>
> Removing --enable-kvm -cpu host from the QEMU command line makes it works as 
> expected:
>
> (gdb) disas start_kernel
> Dump of assembler code for function start_kernel:
> => 0xffffffff83160ff3 <+0>:     call   0xffffffff810788c0 <__fentry__>
>      0xffffffff83160ff8 <+5>:     push   rbp
>      0xffffffff83160ff9 <+6>:     mov    rdi,0xffffffff82e1a9c0
>      0xffffffff83161000 <+13>:    mov    rbp,rsp
>
> Is it possible to make --enable-kvm -cpu host to be able to access memory 
> located in the .init.text section? If some fixes are needed I'll be
> more than happy to help.

Could it be address space randomisation having an effect? I usually turn
it off when debugging kernels although I believe there are runes for gdb
once you know the correct base address.

-- 
Alex Bennée



reply via email to

[Prev in Thread] Current Thread [Next in Thread]