Page 1 of 1

Remote Debugging with bochs

Posted: Tue Sep 11, 2012 2:10 pm
by richi18007
Hi, I have run into a very strange problem :
I tried debugging the kernel remotely using gdb. And all I get is

Code: Select all

[Thread <main>] #1 stopped.
0x00000000 in ?? ()
(gdb) 
Continuing.

[Thread <main>] #1 stopped.
0x00000000 in ?? ()
(gdb) 
Continuing.

[Thread <main>] #1 stopped.
0x00000000 in ?? ()
(gdb) 
Continuing.
The symbol file for the debugger is correct. After inserting the breakpoint, gdb gave me this information

Code: Select all

b main 
Note: breakpoint -1 also set at pc 0xc0100036.
Breakpoint 1 at 0xc0100036: file ./syscore/kernel_main.c, line 39
Also , the bochsrc.txt is as below :-

Code: Select all

megs: 32
romimage: file=/home/sankalps/Downloads/bochs-20120815/bios/BIOS-bochs-legacy , address=0xf0000
vgaromimage: file=/home/sankalps/Downloads/bochs-20120815/bios/VGABIOS-lgpl-latest
floppya: 1_44=floppy.img, status=inserted
boot: a
log: bochsout.txt
gdbstub: enabled=1, port=1234 
mouse: enabled=0
The bochsout.txt gives me this string :

Code: Select all

00000000000i[GDBST] setting breakpoint at c0100036
00000000000i[XGUI ] Mouse capture off
00000000000i[XGUI ] Mouse capture off
00000000000i[XGUI ] Mouse capture off
00000000001i[GDBST] stopped with ac0
00000000001i[XGUI ] Mouse capture off
00000000001i[XGUI ] Mouse capture off
00000000001i[GDBST] Removing breakpoint at c0100036
This ac0 causes the thread stopped in main line to be output I guess. But what is the error? I compiled it using ./configure --enable-gdb-stub.
Please help me find the error.I will recompile bochs in the morning , but gdb could save a lot of time . Bochs internal debugger works fine too. But I don't need debugging at assembly level granularity .

Re: Remote Debugging with bochs

Posted: Wed Sep 12, 2012 5:46 am
by richi18007
Please anybody give some input. I am stuck due to this. The debugger can make the development cycle very fast.

Edit: The error was in the bochsrcs's Rom image address. I loaded it at 0xe0000 , removing that line from the code , and now it works fine.
This helped http://sourceforge.net/projects/bochs/f ... ic/4722168