Debuging without QtCreator

Marco Bernasocchi marco at bernawebdesign.ch
Tue May 1 19:39:41 UTC 2012


Hi Devs, I was wondering what exactly does the android plugin in
QtCreator to allow debugging an app (even a pointer to source would help).
My app is based on cmake and if I try to import it into necessitas
creator I don't get the option to select android as target.
So I o al my building just using the necessitas ndk and qt. I all works.
Now I'd like to start debugging my app and would like to do the same as
creator does.

so far I manage to do:
- deploy a gdbserver in /data/data/$PACKAGE/lib
- echo `$ADB shell top -n 1 | grep $PACKAGE` > $TMP_DIR/pid.txt
   PID=`sed 's/ .*//' $TMP_DIR/pid.txt`
- adb forward tcp:5039 localfilesystem:/data/data/$PACKAGE/debug-pipe
- adb shell run-as $PACKAGE /data/data/$PACKAGE/lib/gdbserver
+debug-pipe --attach $PID

after this I get:
gdbserver:: main
Attached; pid = 2726
Listening on sockaddr socket debug-pipe
Doing accept(temp_desc=3,...)

which is good.

now my question... what from here? I can attach to remote deebug server
in qtcreator and set host and port to localhost:5039 and it kind of
connects but I cant get anything out of it. I'm not so versed in gdb...

Looking at what necessitas does (when debugging an app created with it)
I see this two lines in the compile output after installing the apk:
adb pull /system/bin/app_process $MY_BUILD_DIR/app_process
adb pull /system/lib/libc.so $MY_BUILD_DIR/libc.so

then some magic happens and application output shows the debug messages.


any hint is very welcome


ciao and thanks
-- 
Marco Bernasocchi
www.opengis.ch


More information about the Necessitas-devel mailing list