docs/README-android.md
changeset 9050 bc9616da37cd
parent 9025 d09d4b578e77
child 9055 868b523403e0
     1.1 --- a/docs/README-android.md	Mon Aug 11 22:53:03 2014 +0200
     1.2 +++ b/docs/README-android.md	Mon Aug 11 23:13:20 2014 +0200
     1.3 @@ -144,18 +144,19 @@
     1.4  	src/com/gamemaker/game/MyGame.java
     1.5  
     1.6  Here's an example of a minimal class file:
     1.7 ---- MyGame.java --------------------------
     1.8 -package com.gamemaker.game;
     1.9  
    1.10 -import org.libsdl.app.SDLActivity; 
    1.11 -
    1.12 -/* 
    1.13 - * A sample wrapper class that just calls SDLActivity 
    1.14 - */ 
    1.15 -
    1.16 -public class MyGame extends SDLActivity { }
    1.17 -
    1.18 -------------------------------------------
    1.19 +    --- MyGame.java --------------------------
    1.20 +    package com.gamemaker.game;
    1.21 +    
    1.22 +    import org.libsdl.app.SDLActivity; 
    1.23 +    
    1.24 +    /* 
    1.25 +     * A sample wrapper class that just calls SDLActivity 
    1.26 +     */ 
    1.27 +    
    1.28 +    public class MyGame extends SDLActivity { }
    1.29 +    
    1.30 +    ------------------------------------------
    1.31  
    1.32  Then replace "SDLActivity" in AndroidManifest.xml with the name of your
    1.33  class, .e.g. "MyGame"
    1.34 @@ -320,15 +321,16 @@
    1.35  addresses in the stack trace to lines in your code.
    1.36  
    1.37  For example, if your crash looks like this:
    1.38 -I/DEBUG   (   31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0
    1.39 -I/DEBUG   (   31):  r0 00000000  r1 00001000  r2 00000003  r3 400085d4
    1.40 -I/DEBUG   (   31):  r4 400085d0  r5 40008000  r6 afd41504  r7 436c6a7c
    1.41 -I/DEBUG   (   31):  r8 436c6b30  r9 435c6fb0  10 435c6f9c  fp 4168d82c
    1.42 -I/DEBUG   (   31):  ip 8346aff0  sp 436c6a60  lr afd1c8ff  pc afd1c902  cpsr 60000030
    1.43 -I/DEBUG   (   31):          #00  pc 0001c902  /system/lib/libc.so
    1.44 -I/DEBUG   (   31):          #01  pc 0001ccf6  /system/lib/libc.so
    1.45 -I/DEBUG   (   31):          #02  pc 000014bc  /data/data/org.libsdl.app/lib/libmain.so
    1.46 -I/DEBUG   (   31):          #03  pc 00001506  /data/data/org.libsdl.app/lib/libmain.so
    1.47 +
    1.48 +    I/DEBUG   (   31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0
    1.49 +    I/DEBUG   (   31):  r0 00000000  r1 00001000  r2 00000003  r3 400085d4
    1.50 +    I/DEBUG   (   31):  r4 400085d0  r5 40008000  r6 afd41504  r7 436c6a7c
    1.51 +    I/DEBUG   (   31):  r8 436c6b30  r9 435c6fb0  10 435c6f9c  fp 4168d82c
    1.52 +    I/DEBUG   (   31):  ip 8346aff0  sp 436c6a60  lr afd1c8ff  pc afd1c902  cpsr 60000030
    1.53 +    I/DEBUG   (   31):          #00  pc 0001c902  /system/lib/libc.so
    1.54 +    I/DEBUG   (   31):          #01  pc 0001ccf6  /system/lib/libc.so
    1.55 +    I/DEBUG   (   31):          #02  pc 000014bc  /data/data/org.libsdl.app/lib/libmain.so
    1.56 +    I/DEBUG   (   31):          #03  pc 00001506  /data/data/org.libsdl.app/lib/libmain.so
    1.57  
    1.58  You can see that there's a crash in the C library being called from the main code.
    1.59  I run addr2line with the debug version of my code:
    1.60 @@ -364,11 +366,12 @@
    1.61  
    1.62  Once valgrind is built, you can create a wrapper script to launch your
    1.63  application with it, changing org.libsdl.app to your package identifier:
    1.64 ---- start_valgrind_app -------------------
    1.65 -#!/system/bin/sh
    1.66 -export TMPDIR=/data/data/org.libsdl.app
    1.67 -exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $*
    1.68 -------------------------------------------
    1.69 +
    1.70 +    --- start_valgrind_app -------------------
    1.71 +    #!/system/bin/sh
    1.72 +    export TMPDIR=/data/data/org.libsdl.app
    1.73 +    exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $*
    1.74 +    ------------------------------------------
    1.75  
    1.76  Then push it to the device:
    1.77  	adb push start_valgrind_app /data/local