You do it either way, through gdbclient or through gdbserver
I prefer using gdbclient, its simpler and it requires less commands.
First making sure you adbd is running as root
adb root
Second, shell into your device to find out the app name you want to debug with
adb shell
ps // list all process running in the device
Third, exit the shell connect
exit
last, connect to the app using gdbclient, ex connecting to "mediaserver"
gdbclient mediaserver :5039 mediaserver
by default, remote gdb listen to port 5039, don't get confused with ddms, that's running at 5037 by default.
Hope this helps!