Page 1 of 1
GDB with PIE kernel
Posted: Tue Mar 31, 2020 1:15 am
by Scoopta
I have a position independent kernel and when I map the kernel into high memory and then jump to it gdb loses track of the source code for the executable making debugging difficult. Is there some way for me to have GDB attach the kernel in high memory to the source code?
Re: GDB with PIE kernel
Posted: Thu Apr 02, 2020 6:38 pm
by Scoopta
I went and asked on stackoverflow, if anyone else comes across this topic the way you deal with it is to run
in GDB to clear the existing symbols followed by
Code: Select all
add-symbol-file /path/to/kernel 0x...
where 0x... is the address of your .text section after the remap.