OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Mar 29, 2024 6:52 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [SOLVED] gdb driving me crazy...
PostPosted: Thu Jun 01, 2017 3:56 pm 
Offline
Member
Member
User avatar

Joined: Tue Feb 08, 2011 1:58 pm
Posts: 496
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.
Code:
(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

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...


Top
 Profile  
 
 Post subject: Re: [SOLVED] gdb driving me crazy...
PostPosted: Fri Jun 09, 2017 10:00 pm 
Offline
Member
Member
User avatar

Joined: Sun Oct 18, 2009 5:47 pm
Posts: 208
Location: Alexandria, Egypt | Ottawa, Canada
turdus wrote:
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.
Code:
(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

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...

Try to debug gdb itself using gdb.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 263 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group