GDBDebugging » History » Revision 16
Revision 15 (Denis 'GNUtoo' Carikli, 11/01/2012 11:25 PM) → Revision 16/24 (Denis 'GNUtoo' Carikli, 11/02/2012 08:56 AM)
h1. GDBDebugging Here are some notes on debugging with gdb while rebasing replicant changes on top of the last cyanogenmod. h2. Command line wifi(in case no GUI is available) <pre> adb shell mkdir /data/ctrl </pre> /sdcard/wifi/wpa.conf: <pre> ctrl_interface=DIR=/data/ctrl network={ #your settings go here } </pre> Enable wifi from the commandline <pre> adb shell wpa_supplicant -iwlan0 -Dnl80211 -c/sdcard/wifi/wpa.conf </pre> <pre> adb shell dhcpcd wlan0 </pre> or do: <pre> adb forward tcp:8022 tcp:8022 </pre> h2. GDB debugging(requires a network connection) <pre> adb shell while true;do gdbserver 192.168.20.132:8022 --attach $(pidof system_server);done </pre> <pre> adb forward tcp:8022 tcp:8022 </pre> <pre> . build/envsetup.sh lunch cm_maguro-eng $ arm-linux-androideabi-gdb GNU gdb (GDB) 7.1-android-gg2 Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "--host=i686-linux-gnu --target=arm-elf-linux". For bug reporting instructions, please see: <http://www.gnu.org/software/gdb/bugs/>. (gdb) set sysroot ./out/target/product/maguro/symbols/ (gdb) set solib-search-path ./out/target/product/maguro/symbols/system/lib/:./out/target/product/maguro/symbols/system/lib/hw/:./out/target/product/maguro/symbols/system/vendor/lib/hw/ (gdb) file ./out/target/product/maguro/symbols/system/bin/system_server (gdb) target remote 192.168.20.132:8022 </pre>