Page 1 of 1

proposal for bochs gui debugger

Posted: Thu Dec 10, 2009 11:30 am
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

Re: proposal for bochs gui debugger

Posted: Thu Dec 10, 2009 12:10 pm
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

Re: proposal for bochs gui debugger

Posted: Fri Dec 11, 2009 9:23 am
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

Re: proposal for bochs gui debugger

Posted: Fri Dec 11, 2009 9:41 am
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.

Re: proposal for bochs gui debugger

Posted: Fri Dec 11, 2009 10:12 am
by mcheung63
Hi Solar, cool, thanks

Re: proposal for bochs gui debugger

Posted: Fri Dec 11, 2009 1:35 pm
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.

Re: proposal for bochs gui debugger

Posted: Fri Dec 11, 2009 10:40 pm
by mcheung63
Image

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