[SOLVED] gdb driving me crazy...
Posted: Thu Jun 01, 2017 3:56 pm
So I've downloaded the latest TianoCore ROM and with that I had many problems. No LoadedImageProtocol and no GOP... I've fixed all issues in my bootboot.efi loader (using uefi_call_wrapper directly instead of gnu-efi's LibHandleProtocol seems do the trick with LoadedImageProtocol, and falling back to UGA helps in lack of GOP). But my kernel still triple-faults at some very early stage. So I've decided to debug. And imagine the surprise, when I've realized that I can't. I've spend endless hours figuring out why gdb doesn't honor breakpoints.
Here gdb does not return to the debugger prompt.
If somebody else has the same problem, "program is no longer writeable" error is caused by kvm module enabled in qemu. Without kvm it's works like charm, now I just have to figure out why "layout source" doesn't work...
"Computers are only to solve problems that wouldn't exist without computers"
So true...
Code: Select all
(gdb) break *0xffffffffffe020a9
Breakpoint 1 at 0xffffffffffe020a9
(gdb) c
Continuing.
^C
Program received signal SIGINT, Interrupt.
Cannot remove breakpoints because program is no longer writable.
Further execution is probably impossible.
0xffffffffffe020ba in _start ()
1: x/i $pc
=> 0xffffffffffe020ba <_start+58>: jmp 0xffffffffffe020ba <_start+58>
(gdb) set $pc+=2
(gdb) x/i $pc
=> 0xffffffffffe020bc <_start+60>: xor %rsp,%rsp
(gdb) si
If somebody else has the same problem, "program is no longer writeable" error is caused by kvm module enabled in qemu. Without kvm it's works like charm, now I just have to figure out why "layout source" doesn't work...
"Computers are only to solve problems that wouldn't exist without computers"
So true...