Débogage natif Android (ndk-gdb) sur HTC Desire: run-as défaut?

Je suis en train d'exécuter du code natif de débogage sur mon HTC Desire pour mon projet Android.
Le projet est constitué d'une mince couche de la JNI wrapper et le principal morceau en C++, compilé à l'aide de ndk-build. Le debuggable drapeau est réglé, je suis en cours d'exécution 2.2 sur un HTC Desire et je travaille avec Ubuntu sur mon PC.

Donc une plaine ndk-gdb --start retourne:

ERROR: Could not setup network redirection to gdbserver?
   Maybe using --port=<port> to use a different TCP port might help?

C'est bizarre. J'ai vérifié sur internet et a constaté que c'est le mauvais message d'erreur causée par un défaut dans le ndk-gdb. Si je lance ndk-gdb -- start --verbose-je obtenir cette foiré erreur:

Android NDK installation path: /home/marco/dev/android-ndk
Using specific adb command: /home/marco/dev/android-sdk//platform-tools/adb
ADB version found: Android Debug Bridge version 1.0.26
Using final ADB command: '/home/marco/dev/android-sdk//platform-tools/adb'
Using auto-detected project path: .
Found package name: com.marco83.siege
ABIs targetted by application: armeabi
Device API Level: 8
Device CPU ABIs: armeabi-v7a armeabi
Compatible device ABI: armeabi
Found debuggable flag: true
Found device gdbserver: /data/data/com.marco83.siege/lib/gdbserver
Using gdb setup init: /home/marco/dev/siege_game/trunk/SiegeGameNative/libs/armeabi/gdb.setup
Using toolchain prefix: /home/marco/dev/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-
Using app out directory: /home/marco/dev/siege_game/trunk/SiegeGameNative/obj/local/armeabi
Found data directory: 'run-as: Package 'com.marco83.siege' has corrupt installation'
Found first launchable activity: .Main
Launching activity: com.marco83.siege/.Main
## COMMAND: /home/marco/dev/android-sdk//platform-tools/adb shell am start -n com.marco83.siege/.Main
Starting: Intent { cmp=com.marco83.siege/.Main }
Warning: Activity not started, its current task has been brought to the front
## COMMAND: /home/marco/dev/android-sdk//platform-tools/adb shell sleep 2
Found running PID: 844
Launched gdbserver succesfully.
Setup network redirection
## COMMAND: /home/marco/dev/android-sdk//platform-tools/adb forward tcp:5039 localfilesystem:run-as: Package 'com.marco83.siege' has corrupt installation/debug-socket
## COMMAND: /home/marco/dev/android-sdk//platform-tools/adb shell run-as com.marco83.siege lib/gdbserver +debug-socket --attach 844
Android Debug Bridge version 1.0.26
-d                            - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e                            - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number>            - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
environment variable.
-p <product name or path>     - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices                       - list all connected devices
connect <host>[:<port>]       - connect to a device via TCP/IP
Port 5555 is used by default if no port number is specified.
disconnect [<host>[:<port>]]  - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number is specified.
Using this ocmmand with no additional arguments
will disconnect from all connected TCP/IP devices.
device commands:
adb push <local> <remote>    - copy file/dir to device
adb pull <remote> [<local>]  - copy file/dir from device
adb sync [ <directory> ]     - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell                    - run remote shell interactively
adb shell <command>          - run remote shell command
adb emu <command>            - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of: 
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp                     - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport                - return all information from the device
that should be included in a bug report.
adb help                     - show this help message
adb version                  - show version num
DATAOPTS:
(no option)                   - don't touch the data partition
-w                           - wipe the data partition
-d                           - flash the data partition
scripting:
adb wait-for-device          - block until device is online
adb start-server             - ensure that there is a server running
adb kill-server              - kill the server if it is running
adb get-state                - prints: offline | bootloader | device
adb get-serialno             - prints: <serial-number>
adb status-window            - continuously print device status for a specified device
adb remount                  - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb reboot-bootloader        - reboots the device into the bootloader
adb root                     - restarts the adbd daemon with root permissions
adb usb                      - restarts the adbd daemon listening on USB
adb tcpip <port>             - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters]   - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE                    - Print debug information. A comma separated list of the following values
1 or all, adb, sockets, packets, rwx, usb, sync, sysdeps, transport, jdwp
ANDROID_SERIAL               - The serial number to connect to. -s takes priority over this if given.
ANDROID_LOG_TAGS             - When used with the logcat option, only these debug tags are printed.
ERROR: Could not setup network redirection to gdbserver?
Maybe using --port=<port> to use a different TCP port might help?
marco@pacer:~/dev/siege_game/trunk/SiegeGameNative$ run-as: Package 'com.marco83.siege' has corrupt installation

qui, comme vous pouvez le voir et comme indiqué ici: http://vilimpoc.org/blog/2010/09/23/hello-gdbserver-a-debuggable-jni-example-for-android/ est causée par un mélange de différentes sorties simultanées; le vrai message d'erreur devrait être

Package 'xxxxx' has corrupt installation

Approfondies dans le cadre de cette erreur m'a indiqué: http://osdir.com/ml/android-ndk/2010-08/msg00263.html

où la même erreur est signalée, et ils disent qu'il n'est pas possible de débogage en mode natif sur le Désir. Le problème, c'est avec run-as ne pas être en mesure d'accéder à l' /dossier de données.

Toute autre solution que l'enracinement/flashage du téléphone? Pourquoi le run-as d'accès /données?
Je pensais à une solution naïve où j'ai copier le package (objs, libs, ...) en plus de faciliter l'accessibilité de l'emplacement (comme sur la SDcard) et dire le débogueur pour accéder à cet emplacement à la place - est-ce faisable?

Merci
Marco

EDIT: mise à Jour: je enracinée le téléphone à l'aide de unrevoked3. Même si j'ai mis chmod 0777 data (qui est probablement EXTRÊMEMENT dangereux), j'obtiens la même erreur. Comme indiqué dans le deuxième lien dans le post, comme c'est de vérifier si les données sont accessibles. Comment puis-je accéder à l'exécution du code source? Est-il possible de recompiler et de télécharger une version modifiée qui travaille autour de cette case? (depuis, je peux mettre /de données pour être lisible par tout le monde de toute façon)

source d'informationauteur Marco83 | 2011-02-02