Project

General

Profile

GDBDebugging » History » Version 24

Wolfgang Wiedmeyer, 04/26/2017 08:45 PM
add todo note

1 22 Paul Kocialkowski
h1. GDB debugging
2 1 Denis 'GNUtoo' Carikli
3 24 Wolfgang Wiedmeyer
The instructions below need to be tested if they still work with a current Replicant release and "these notes for Replicant 6.0":https://blog.fossencdi.org/notes.html#gdb-debugging should be added, but with more details. 
4
5 23 Paul Kocialkowski
Here are some notes on debugging with GDB:
6 14 Denis 'GNUtoo' Carikli
7 1 Denis 'GNUtoo' Carikli
<pre>
8 12 Denis 'GNUtoo' Carikli
adb shell
9 18 Denis 'GNUtoo' Carikli
gdbserver 127.0.0.1:8022 --attach $(pidof mediaserver )
10 13 Denis 'GNUtoo' Carikli
</pre>
11 15 Denis 'GNUtoo' Carikli
12 10 Denis 'GNUtoo' Carikli
<pre>
13 2 Denis 'GNUtoo' Carikli
adb forward tcp:8022 tcp:8022
14 3 Denis 'GNUtoo' Carikli
</pre>
15
16
<pre>
17
. build/envsetup.sh
18 19 Denis 'GNUtoo' Carikli
lunch replicant_maguro-eng
19 3 Denis 'GNUtoo' Carikli
20
$ arm-linux-androideabi-gdb
21
GNU gdb (GDB) 7.1-android-gg2
22
Copyright (C) 2010 Free Software Foundation, Inc.
23
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
24
This is free software: you are free to change and redistribute it.
25
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
26
and "show warranty" for details.
27
This GDB was configured as "--host=i686-linux-gnu --target=arm-elf-linux".
28
For bug reporting instructions, please see:
29
<http://www.gnu.org/software/gdb/bugs/>.
30 1 Denis 'GNUtoo' Carikli
(gdb) set sysroot ./out/target/product/maguro/symbols/
31 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/
32 20 Denis 'GNUtoo' Carikli
(gdb) file ./out/target/product/maguro/symbols/system/bin/mediaserver
33
(gdb) target remote 127.0.0.1:8022
34 3 Denis 'GNUtoo' Carikli
35 1 Denis 'GNUtoo' Carikli
</pre>