17.01.2014 Views

The holy bible of SWEB - Institute of Applied Information Processing ...

The holy bible of SWEB - Institute of Applied Information Processing ...

The holy bible of SWEB - Institute of Applied Information Processing ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

2.3. QEMU CHAPTER 2. GDB<br />

<strong>The</strong> patch file is located at ...sweb/utils/bochs<br />

• Once the source files are patched we can run the configure script. It is recommended<br />

to use an alternative prefix (installation location) to be able to switch<br />

between different bochs versions (e.g. patched not patched version)<br />

$ ./ configure −−enable−gdb−stub −−prefix=/opt/sweb−bochs<br />

• Once the configuration is done, start compiling and installing<br />

$ make<br />

$ sudo make i n s t a l l<br />

Needless to say that you need some default dev packages like gcc to successfully<br />

complete the compile process, in addition you need a package called xorg-dev or<br />

x-window-system-dev on some other systems<br />

• Self - compiling bochs does not replace installing the packages vgabios and<br />

bochsbios<br />

2.3 Qemu<br />

For using the gdb stub from qemu, start it with<br />

$ make qemugdb<br />

2.4 Using GDB<br />

With bochs or qemu started as described before, gdb can connect to it. <strong>The</strong>re is a<br />

make target rungdb which preconfigures GDB and connects to localhost:1234.<br />

$ make rungdb<br />

.<br />

.<br />

.<br />

0x0000fff0 in ?? ( )<br />

You can now set trace and breakpoints .<br />

Enter ’ continue ’ ( or ’ c ’ ) when you ’ re done .<br />

( gdb )<br />

Once bochs or qemu exits you could end GDB and run make rungdb again, but then<br />

all you temporary settings like breakpoints are gone and you have to set them up<br />

again. So there is another way to reconnect GDB to bochs or qemu. Just run the<br />

following from inside GDB and all your breakpoints and other settings remain active.<br />

target remote localhost :1234<br />

From here, gdb can be used as usual, except that it is not necessary to call run, as<br />

the simulation is already started but paused for command input. It can be resumed<br />

using the continue command.<br />

20 <strong>of</strong> 151

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!