I have a trouble to connect SimNow with gdb.
My environment is:
physical pc: Intel Core2 Q8000
host: windows 7
In my host, I run a VirtualBox 4.1.10
In VirtualBox, I run fedora 3.3.0-4.fc16.x86_64
In fedora, I run SimNow 4.6.2
I want to debug some C codes which directly runs on SimNow.
1.I choose cheetah_1p.bsd, disk
3.I do not know when I can start gdb server. I just type "shell.gdb" a few seconds after starting simulation.
4. I open another linux terminal in fedora.type:
set architecture i386:x86-64
The screen is as follow. When the gdb connect successfully, the simulation does not stop. I think it should be stopped. I type some instruction like
break *0x7c00, but it does not work. It seems that gdb did not control the simulation. I do not know the reason. I will change the CPU to AMD in several days. But I do not think it is the problem. Is there anything I should consider, but i does not list it here?
My kernel file is compiled with flag "-m32", it is 32 bits. I do not know if i should use "set architecture i386".
Another case, if I do not load any symbol file for gdb, SimNow will crash when the bios test all memory. I think gdb can work without source file. I do not know what happens.
[pan@localhost ~]$ gdb kernel
GNU gdb (GDB) Fedora (188.8.131.5210722-9.fc16)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
Reading symbols from /home/pan/kernel...done.
(gdb) set architecture i386:x86-64
The target architecture is assumed to be i386:x86-64
(gdb) target remote:2222
Remote debugging using :2222
0x0000000000000000 in ?? ()
(gdb) break *0x7c00
Breakpoint 1 at 0x7c00
(gdb) break *0x8000000
Note: breakpoint -1 also set at pc 0x8000000.
Breakpoint 2 at 0x8000000: file boot.S, line 28.
(gdb) info breakpoints
Num Type Disp Enb Address What
1 breakpoint keep y 0x0000000000007c00
2 breakpoint keep y 0x08000000 boot.S:28
BSD Load completed!
ATA: Image [/home/pan/mavmm.hdd] does not have an ID field.
1 simnow> shell.gdb