From 33629797add47f16a5521813ae06d6196a83cc57 Mon Sep 17 00:00:00 2001 From: Scott Rifenbark Date: Mon, 25 Mar 2013 09:32:49 -0700 Subject: [PATCH] dev-manual: Edits to the Using GDB section Fixes YOCTO #3540 First pass at altering this section based on changed methods and Jessica Zhang's instructions. Rather than fully removing a couple of sections that have quite a bit of information, I decided to comment them out for now. Once the material is reviewed I can remove the sections for good. (From yocto-docs rev: bde7771166a178dd283fc9baacbee5239c679251) Signed-off-by: Scott Rifenbark Signed-off-by: Richard Purdie --- .../dev-manual/dev-manual-common-tasks.xml | 66 +++++++++++++++++-- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/documentation/dev-manual/dev-manual-common-tasks.xml b/documentation/dev-manual/dev-manual-common-tasks.xml index aa52d17025..344b06b0aa 100644 --- a/documentation/dev-manual/dev-manual-common-tasks.xml +++ b/documentation/dev-manual/dev-manual-common-tasks.xml @@ -3228,7 +3228,7 @@
- Launching GDB on the Host Computer + Launch GDB on the Host Computer Running GDB on the host computer takes a number of stages. @@ -3236,13 +3236,13 @@
- Building the Cross-GDB Package + Build the Cross-GDB Package A suitable GDB cross-binary is required that runs on your host computer but also knows about the the ABI of the remote target. You can get this binary from the meta-toolchain. Here is an example where the toolchain has been installed - in the default directory /opt/poky/1.4: + in the default directory /opt/poky/&DISTRO;: /opt/poky/1.4/sysroots/i686-pokysdk-linux/usr/bin/armv7a-vfp-neon-poky-linux-gnueabi/arm-poky-linux-gnueabi-gdb @@ -3263,6 +3263,63 @@
+
+ Create the GDB Initialization File + + + Aside from the GDB cross-binary, you also need a GDB + initialization file in the same top directory in which + your binary resides. + When you start GDB on your host development system, GDB + finds this initialization file and executes all the + commands within. + For information on the .gdbinit, see + "Debugging with GDB" + by maintained by + sourceware.org. + +
+ +
+ Point to Your Root Filesystem + + + Before starting your debugging session, you need to enter + the following to set your sysroot filesystem location + by using a command with this form: + + set sysroot <your-sysroot-path> + + +
+ +
+ Launch the Host GDB + + + To launch the host GDB, you need to source the + cross-debugging environment script, which if you installed + the sysroot filesystem in the default location is at + /opt/poky/&DISTRO; and begins with the + string "environment-setup". + + + + Finally, run the cross-gdb binary + and provide the inferior binary as part of the command line. + For example, the following command form continues with the + example used in the previous section. + This command form loads the foo binary + as well as the debugging information: + + $ <target-abi>-gdb rootfs/usr/bin/foo + + The commands in your .gdbinit execute + and the GDB prompt appears. + +
+ +
- Using the Debugger + Use the Debugger You can now proceed with debugging as normal - as if you were debugging