Files
android_development/simulator/wrapsim
Andy McFadden 26dc36123f Sim fixes.
Pulled a fix to the simulator app ("long" is 64-bit when 32-bit was
needed) from master.  sim-eng is useful for verifying the x86 SMP stuff.

Also quieted a compiler warning.

Change-Id: I399ea4923b7e0650d5f995e056c751374b057fbd
2010-05-21 11:00:14 -07:00
..
2009-03-03 19:29:09 -08:00
2009-03-03 19:29:09 -08:00
2010-05-21 11:00:14 -07:00

This shared library is used with LD_PRELOAD to wrap the Android runtime
when used with the desktop simulator.

Because LD_PRELOAD is part of the environment when gdb and valgrind are
invoked, the wrapper can "see" activity from both of these (more so gdb
than valgrind).  For this reason it needs to be very careful about which
"open" calls are intercepted.

It's also important that none of the intercepted system or library calls
are invoked directly, or infinite recursion could result.

Avoid creating dependencies on other libraries.


To debug wrapsim, set WRAPSIM_LOG to a log file before launching, e.g.

% WRAPSIM_LOG=/tmp/wraplog.txt simulator

For more verbose logging, you can enable the verbose forms of CALLTRACE
and CALLTRACEV in Intercept.c.

To build, you will need to have the 32-bit libaudio2 development package
installed. On Ubuntu Hardy, do something like:
% sudo apt-get install lib32asound2-dev