Open main menu

Difference between revisions of "HOWTO-Debug-Endian-Issues"

Final draft of HOWTO Debug Endian Issues
(Update third draft of HOWTO on Debugging Endian Issues.)
(Final draft of HOWTO Debug Endian Issues)
Line 43: Line 43:
  pause
  pause
* Install a PPC Linux distribution onto the QEMU PPC VM.
* Install a PPC Linux distribution onto the QEMU PPC VM.
** [http://people.debian.org/~aurel32/qemu/powerpc/ Prebuild Debian PPC QEMU Images]
** The full method here is to create a blank QCOW2 disk image file with the qemu-tools and then use this as the main emulated hard disk via the "-hda" option, then add a Linux PPC CDROM ISO image using the "-cdrom" option, start QEMU and do the distribution installation procedure as normal.
** However, Debian Linux Squeeze for PPC is suggested as prebuilt disk images are available [http://people.debian.org/~aurel32/qemu/powerpc/ here].
* Enable VM network access proxied via the host system.
* Enable VM network access proxied via the host system.
** QEMU should be providing a virtual ethernet network adapter to the VM, which will provide access to the internet via the host's internet connection. This can be checked by the normal methods such as ICMP ping. If this is not working, check on your host machine, then refer to the QEMU documentation for any missing configuration setting and to see if the hosted OS requires any device driver to allow this virtual device to work.
** By default, QEMU should be providing a virtual ethernet network adapter to the VM, which will provide access to the internet via the host's connection. This can be checked by the normal methods such as ICMP ping within the VM OS. If this is not working, check on your host machine, then refer to the QEMU documentation for any missing configuration setting and to see if the hosted OS requires any device driver to allow this virtual device to work.
* Install any OS updates to the VM.
** Especially when using the prebuilt images, OS system updates should be done via the normal method to ensure up to date system libraries are installed.
*** Debian: <pre>apt-get update</pre>
* Install the ScummVM source code, required libraries and compile a debug build.
* Install the ScummVM source code, required libraries and compile a debug build.
* Within the VM, this now be done as per a normal Linux machine:
* Within the VM, this can now be done as per a normal Linux build:
** Getting ScummVM source tree: <pre>git clone git://github.com/scummvm/scummvm.git</pre>
** Getting ScummVM source tree: <pre>git clone git://github.com/scummvm/scummvm.git</pre>
*** Refer to [[Developer_Central#Getting_started here]] for more help.
*** Refer to [[Developer_Central#Getting_started |here]] for more help.
** Install any required libraries: <pre>apt-get install libsdl12dev</pre>
** Install any required libraries: <pre>apt-get install libsdl12dev</pre>
** Compiling ScummVM: <pre>cd scummvm && ./configure && make clean && make</pre>
** Compiling ScummVM: <pre>cd scummvm && ./configure && make clean && make</pre>
*** Refer to [[Compiling_ScummVM/GCC here]] for more help.
*** Refer to [[Compiling_ScummVM/GCC |here]] for more help.
* Provide game data.
* Provide game data to the VM.
** Though QEMU can provide access to host directories as emulated FAT formatted drives by this option: <pre> -drive file=fat:ro:some-directory</pre>, this only supports FAT-16 and is thus limited to 2GB maximum. It is suggested to use the <pre> -cdrom </pre> option with a ISO image instead. CD swapping is not possible, but it is fairly easy to create a ISO image from a set of files in the same way as prior to writing a CD.
** Transferring data to the host VM by normal network file transfer is also possible i.e. SSH from the VM to host or another machine, HTTP download, etc.
* Install debugging tools.
* Install debugging tools.
** <pre>apt-get install gdb</pre>
** <pre>apt-get install valgrind</pre>
*** Note: Valgrind is currently broken on Debian Squeeze PPC. If you want to install this, you will need to add the apt repositories for "Wheezy" and install the updated version from there.
* Debugging can then be done as per a normal native Linux machine, though patience may be required as the VM will be much slower than a native machine.


== GXemul ==
A preinstalled standard desktop Debian Squeeze PPC QEMU hard disk image in qcow2 format can be provided by the ScummVM development team, but since this is over 5GB, this is currently only provided on request, rather than on the download site.


* [http://gxemul.sourceforge.net/ Main Website]
== Debugging for Other Architectures ==
 
The instructions above should be valid for emulation and debugging of other uncommon machine architectures e.g. MIPS, provided that QEMU supports that architecture e.g. use qemu-system-mips, rather than ppc, and a Linux distribution or other Unix is available for that architecture as a installation CD ISO image.
 
However, there are a few architectures which QEMU does not support, notably [https://en.wikipedia.org/wiki/SuperH SH]. However, there is another general purpose CPU/machine emulator called [http://gxemul.sourceforge.net/ GXemul] which does support this and some other more esoteric platforms. This is less supported than QEMU, but this procedure should be possible with some modifications. Any notes on this would be gratefully received by the team.
TrustedUser
574

edits