proposal for bochs gui debugger

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

proposal for bochs gui debugger

Post by mcheung63 »

goal : single step trace in C-source-code-level using bochs

Steps:
1) press the "open" button to open your a.out elf file
2) the debugger will detect how many .c file is in that a.out
3) display all the .c files in bochs gui debugger
4) type in the physical address of the executable startup address (although the ELF have the startup address, but it is a virutal address, and bochs cannot set a virutal address breakpoint, so you have to enter the physical address)
5) double click on the source to set the breakpoint, because you have entered the physical address, so I can use that address plus the offset to calculate the actual breakpoint address.
6) everything done, press the "run" button, bochs will pause if the breakpoint is hit.

Is it good enough for OS developer to debug their ELF kernel/app? I think no, so please tell me your idea.

thanks
from Peter
Mark139
Member
Member
Posts: 39
Joined: Mon Jan 15, 2007 2:32 pm

Re: proposal for bochs gui debugger

Post by Mark139 »

Doesn't BOCHS support GDB debugging? You can connect it to your favorite GUI.
I use QEMU myself at the moment with Eclipse to debug. As a bonus it's all running on my Mac OSX laptop :)

Mark
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Re: proposal for bochs gui debugger

Post by mcheung63 »

Hi Mark. Is QEMU has a debugger? What do you mean by using your eclipse to debug your os?

I think I have these advantages:
1) GDB with bochs is not flexible, it assume my ELF is loaded at somewhere
2) I want to make a GUI that very fit to debug my OS :P
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Re: proposal for bochs gui debugger

Post by Solar »

mcheung63 wrote:1) GDB with bochs is not flexible, it assume my ELF is loaded at somewhere
I am not sure what you mean with that. You start GDB giving it the name of your binary, and you can't debug what isn't in memory, so how is that "not flexible"?
2) I want to make a GUI that very fit to debug my OS :P
There are several GUIs for GDB available, DDD being just one of them.
Every good solution is obvious once you've found it.
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Re: proposal for bochs gui debugger

Post by mcheung63 »

Hi Solar, cool, thanks
Mark139
Member
Member
Posts: 39
Joined: Mon Jan 15, 2007 2:32 pm

Re: proposal for bochs gui debugger

Post by Mark139 »

QEMU is the emulator that can emulate platforms other than x86. I'm using it for ARM coding. It has the ability to load an ELF kernel.
User avatar
mcheung63
Member
Member
Posts: 175
Joined: Thu Jun 22, 2006 8:33 am
Location: Hong Kong
Contact:

Re: proposal for bochs gui debugger

Post by mcheung63 »

Image

ok, can dump the line number now, look at the upper-right panel.
Post Reply