-rw-r--r-- | development/cross-debug/README.cross-debug | 82 | ||||
-rwxr-xr-x | development/cross-debug/arm-linux-gdb | bin | 0 -> 1676116 bytes | |||
-rw-r--r-- | development/cross-debug/gdbserver_0.0-20020729_arm.ipk | bin | 0 -> 17876 bytes | |||
-rw-r--r-- | development/cross-debug/sample.arm-gdbinit | 19 |
4 files changed, 101 insertions, 0 deletions
diff --git a/development/cross-debug/README.cross-debug b/development/cross-debug/README.cross-debug new file mode 100644 index 0000000..c44b298 --- a/dev/null +++ b/development/cross-debug/README.cross-debug | |||
@@ -0,0 +1,82 @@ | |||
1 | |||
2 | This is a quick'n'dirty HowTo for cross-debugging on your iPAQ/Zaurus: | ||
3 | |||
4 | Requirements: | ||
5 | ------------- | ||
6 | |||
7 | 1) You need the same binary of the program being debugged on the handheld | ||
8 | and on the desktop machine. | ||
9 | |||
10 | 2) The binary for the handheld can be stripped (!!) | ||
11 | |||
12 | 3) The binary for the desktop must have been compiled with -g | ||
13 | |||
14 | 3) The same applies to shared libraries (but this is only needed if you want | ||
15 | to step into libraries or if you want the backtrace to show the right | ||
16 | function names for libraries) | ||
17 | |||
18 | |||
19 | Setup: | ||
20 | ------ | ||
21 | |||
22 | 1) install the gdbserver.ipk on the handheld. | ||
23 | |||
24 | 2) put the arm-linux-gdb binary somewhere in your $PATH (I would suggest | ||
25 | /opt/Embedix/tools/arm-linux/bin) | ||
26 | |||
27 | 3) copy the sample.arm-gdbinit to your $HOME directory and rename it to | ||
28 | .arm-gdbinit | ||
29 | |||
30 | 4) edit ~/.arm-gdbinit: | ||
31 | "solib-search-path" is the path, where gdb searches for shared libraries | ||
32 | "rtX" are some aliases to speed up debugging -- you can rename them, or | ||
33 | remove them (see below for the "target ... " syntax) | ||
34 | |||
35 | |||
36 | Sample session: debugging the launcher | ||
37 | -------------------------------------- | ||
38 | |||
39 | 1) Login on the handheld, kill Opie and execute: | ||
40 | |||
41 | # gdbserver foo:2345 /opt/QtPalmtop/bin/qpe | ||
42 | |||
43 | This starts the program qpe in debug mode, and the gdbserver stub now | ||
44 | listens on port 2345 for an incoming connection from the real gdb. | ||
45 | (foo should be name of the desktop machine, but it is ignored) | ||
46 | |||
47 | 2) On the desktop, change to the $OPIEDIR containing the arm binaries | ||
48 | |||
49 | # cd $OPIEDIR | ||
50 | # cd core/launcher | ||
51 | |||
52 | # arm-linux-gdb ../../bin/qpe | ||
53 | or | ||
54 | # ddd --debugger arm-linux-gdb ../../bin/qpe | ||
55 | |||
56 | 3) You should get an "(arm-gdb)" prompt. Now do | ||
57 | |||
58 | (arm-gdb) target remote zaurus:2345 | ||
59 | |||
60 | You have to change zaurus to the hostname or ip-address of your handheld. | ||
61 | This should produce: | ||
62 | |||
63 | Remote debugging using zaurus:2345 | ||
64 | 0x40002a80 in ?? () | ||
65 | |||
66 | (arm-gdb) break main | ||
67 | (arm-gdb) cont | ||
68 | |||
69 | And gdb should stop in 'main'. If gdb complains about unknown symbol | ||
70 | 'main', you forgot to compile the application in debug mode. | ||
71 | |||
72 | This is where the rtFOO macros come in handy: just type rtX and you are | ||
73 | connected to machine BAR. | ||
74 | |||
75 | 4) You can debug/step your application, as you would with a native gdb from | ||
76 | here on. | ||
77 | |||
78 | Please note that single stepping in a cross-debugger can be VERY SLOW | ||
79 | sometimes !! | ||
80 | |||
81 | |||
82 | Robert 'sandman' Griebl, 17.11.2002 | ||
diff --git a/development/cross-debug/arm-linux-gdb b/development/cross-debug/arm-linux-gdb new file mode 100755 index 0000000..17ff0e1 --- a/dev/null +++ b/development/cross-debug/arm-linux-gdb | |||
Binary files differ | |||
diff --git a/development/cross-debug/gdbserver_0.0-20020729_arm.ipk b/development/cross-debug/gdbserver_0.0-20020729_arm.ipk new file mode 100644 index 0000000..60c5e43 --- a/dev/null +++ b/development/cross-debug/gdbserver_0.0-20020729_arm.ipk | |||
Binary files differ | |||
diff --git a/development/cross-debug/sample.arm-gdbinit b/development/cross-debug/sample.arm-gdbinit new file mode 100644 index 0000000..9d09ace --- a/dev/null +++ b/development/cross-debug/sample.arm-gdbinit | |||
@@ -0,0 +1,19 @@ | |||
1 | set solib-absolute-prefix /dev/null | ||
2 | set solib-search-path /home/sandman/work/opie/lib:/opt/Embedix/tools/arm-linux/lib | ||
3 | |||
4 | define rtz | ||
5 | target remote zaurus:2345 | ||
6 | break main | ||
7 | end | ||
8 | |||
9 | define rt36 | ||
10 | target remote ipaq2:2345 | ||
11 | break main | ||
12 | end | ||
13 | |||
14 | |||
15 | define rt38 | ||
16 | target remote ipaq:2345 | ||
17 | break main | ||
18 | end | ||
19 | |||