GDBDebugging » History » Version 13
Denis 'GNUtoo' Carikli, 08/20/2012 02:07 PM
1 | 1 | Denis 'GNUtoo' Carikli | h1. GDBDebugging |
---|---|---|---|
2 | 5 | Denis 'GNUtoo' Carikli | |
3 | 3 | Denis 'GNUtoo' Carikli | Here are some notes on debugging with gdb while rebasing replicant changes on top of the last cyanogenmod. |
4 | 1 | Denis 'GNUtoo' Carikli | |
5 | 13 | Denis 'GNUtoo' Carikli | |
6 | h2. Command line wifi(in case no GUI is available) |
||
7 | 1 | Denis 'GNUtoo' Carikli | <pre> |
8 | 12 | Denis 'GNUtoo' Carikli | adb shell |
9 | mkdir /data/ctrl |
||
10 | </pre> |
||
11 | 13 | Denis 'GNUtoo' Carikli | |
12 | /sdcard/wifi/wpa.conf: |
||
13 | 12 | Denis 'GNUtoo' Carikli | <pre> |
14 | 11 | Denis 'GNUtoo' Carikli | ctrl_interface=DIR=/data/ctrl |
15 | network={ |
||
16 | #your settings go here |
||
17 | } |
||
18 | 1 | Denis 'GNUtoo' Carikli | </pre> |
19 | 13 | Denis 'GNUtoo' Carikli | Enable wifi from the commandline |
20 | 11 | Denis 'GNUtoo' Carikli | <pre> |
21 | 2 | Denis 'GNUtoo' Carikli | adb shell |
22 | 10 | Denis 'GNUtoo' Carikli | wpa_supplicant -iwlan0 -Dnl80211 -c/sdcard/wifi/wpa.conf |
23 | </pre> |
||
24 | |||
25 | <pre> |
||
26 | adb shell |
||
27 | dhcpcd wlan0 |
||
28 | 1 | Denis 'GNUtoo' Carikli | </pre> |
29 | 13 | Denis 'GNUtoo' Carikli | |
30 | h2. GDB debugging(requires a network connection) |
||
31 | 10 | Denis 'GNUtoo' Carikli | |
32 | <pre> |
||
33 | adb shell |
||
34 | 2 | Denis 'GNUtoo' Carikli | while true;do gdbserver 192.168.20.132:8022 --attach $(pidof system_server);done |
35 | 3 | Denis 'GNUtoo' Carikli | </pre> |
36 | |||
37 | <pre> |
||
38 | . build/envsetup.sh |
||
39 | lunch cm_maguro-eng |
||
40 | |||
41 | $ arm-linux-androideabi-gdb |
||
42 | GNU gdb (GDB) 7.1-android-gg2 |
||
43 | Copyright (C) 2010 Free Software Foundation, Inc. |
||
44 | License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> |
||
45 | This is free software: you are free to change and redistribute it. |
||
46 | There is NO WARRANTY, to the extent permitted by law. Type "show copying" |
||
47 | and "show warranty" for details. |
||
48 | This GDB was configured as "--host=i686-linux-gnu --target=arm-elf-linux". |
||
49 | For bug reporting instructions, please see: |
||
50 | <http://www.gnu.org/software/gdb/bugs/>. |
||
51 | 1 | Denis 'GNUtoo' Carikli | (gdb) set sysroot ./out/target/product/maguro/symbols/ |
52 | 9 | Denis 'GNUtoo' Carikli | (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/ |
53 | 7 | Denis 'GNUtoo' Carikli | (gdb) file ./out/target/product/maguro/symbols/system/bin/system_server |
54 | 6 | Denis 'GNUtoo' Carikli | (gdb) target remote 192.168.20.132:8022 |
55 | 3 | Denis 'GNUtoo' Carikli | |
56 | 1 | Denis 'GNUtoo' Carikli | </pre> |