summaryrefslogtreecommitdiff
path: root/development/cross-debug
authorsandman <sandman>2002-11-17 22:32:35 (UTC)
committer sandman <sandman>2002-11-17 22:32:35 (UTC)
commitee9696cbb7a39e0f13739ae86cd925b0f675a43c (patch) (side-by-side diff)
treed7ce00eb2be8632c73abc4e1a83aa51823b059a0 /development/cross-debug
parent2f87d2f9155285d853b66bb08e43b275f6284226 (diff)
downloadopie-ee9696cbb7a39e0f13739ae86cd925b0f675a43c.zip
opie-ee9696cbb7a39e0f13739ae86cd925b0f675a43c.tar.gz
opie-ee9696cbb7a39e0f13739ae86cd925b0f675a43c.tar.bz2
ARM Cross-Debgging tools and a short HOWTO
Diffstat (limited to 'development/cross-debug') (more/less context) (ignore whitespace changes)
-rw-r--r--development/cross-debug/README.cross-debug82
-rwxr-xr-xdevelopment/cross-debug/arm-linux-gdbbin0 -> 1676116 bytes
-rw-r--r--development/cross-debug/gdbserver_0.0-20020729_arm.ipkbin0 -> 17876 bytes
-rw-r--r--development/cross-debug/sample.arm-gdbinit19
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 @@
+
+This is a quick'n'dirty HowTo for cross-debugging on your iPAQ/Zaurus:
+
+Requirements:
+-------------
+
+1) You need the same binary of the program being debugged on the handheld
+ and on the desktop machine.
+
+2) The binary for the handheld can be stripped (!!)
+
+3) The binary for the desktop must have been compiled with -g
+
+3) The same applies to shared libraries (but this is only needed if you want
+ to step into libraries or if you want the backtrace to show the right
+ function names for libraries)
+
+
+Setup:
+------
+
+1) install the gdbserver.ipk on the handheld.
+
+2) put the arm-linux-gdb binary somewhere in your $PATH (I would suggest
+ /opt/Embedix/tools/arm-linux/bin)
+
+3) copy the sample.arm-gdbinit to your $HOME directory and rename it to
+ .arm-gdbinit
+
+4) edit ~/.arm-gdbinit:
+ "solib-search-path" is the path, where gdb searches for shared libraries
+ "rtX" are some aliases to speed up debugging -- you can rename them, or
+ remove them (see below for the "target ... " syntax)
+
+
+Sample session: debugging the launcher
+--------------------------------------
+
+1) Login on the handheld, kill Opie and execute:
+
+ # gdbserver foo:2345 /opt/QtPalmtop/bin/qpe
+
+ This starts the program qpe in debug mode, and the gdbserver stub now
+ listens on port 2345 for an incoming connection from the real gdb.
+ (foo should be name of the desktop machine, but it is ignored)
+
+2) On the desktop, change to the $OPIEDIR containing the arm binaries
+
+ # cd $OPIEDIR
+ # cd core/launcher
+
+ # arm-linux-gdb ../../bin/qpe
+ or
+ # ddd --debugger arm-linux-gdb ../../bin/qpe
+
+3) You should get an "(arm-gdb)" prompt. Now do
+
+ (arm-gdb) target remote zaurus:2345
+
+ You have to change zaurus to the hostname or ip-address of your handheld.
+ This should produce:
+
+ Remote debugging using zaurus:2345
+ 0x40002a80 in ?? ()
+
+ (arm-gdb) break main
+ (arm-gdb) cont
+
+ And gdb should stop in 'main'. If gdb complains about unknown symbol
+ 'main', you forgot to compile the application in debug mode.
+
+ This is where the rtFOO macros come in handy: just type rtX and you are
+ connected to machine BAR.
+
+4) You can debug/step your application, as you would with a native gdb from
+ here on.
+
+ Please note that single stepping in a cross-debugger can be VERY SLOW
+ sometimes !!
+
+
+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 @@
+set solib-absolute-prefix /dev/null
+set solib-search-path /home/sandman/work/opie/lib:/opt/Embedix/tools/arm-linux/lib
+
+define rtz
+target remote zaurus:2345
+break main
+end
+
+define rt36
+target remote ipaq2:2345
+break main
+end
+
+
+define rt38
+target remote ipaq:2345
+break main
+end
+