Debugging guide for gdb and eclipse this document guides the user through
Debugging Guide for GDB and Eclipse by Brian Fraser Last update Sept This document guides the user through Debugging an application using GDB command prompt Debugging an application using Eclipse Generating and loading core ?les Stripping debug symbols from a binary Table of Contents Installing gdb- multiarch If Running Ubuntu xx If Running Ubuntu GDB Eclipse Eclipse Installation and Project Setup Debugging with Eclipse Core Dumps Stripping a Binary Note This guide has not yet been tested in the SFU Surrey Linux Lab SUR Some changes may be needed Formatting Commands starting with are host Linux console commands echo Hello world Commands starting with are target Linux console commands echo On the target Hello world Commands starting with gdb are GDB console commands Almost all commands are case sensitive in Linux and GDB Revision History ? Sept Initial version for fall ? Sept Added directions for installing gdbserver on target PDF Created C Installing gdb-multiarch The host needs a cross-debugger to debug an application running on the target GDB GNU Debugger has a version which supports multiple architectures such as ARM MIPS ? named gdb- multiarch If Running Ubuntu xx Install GDB and GDB multi-architecture sudo apt-get install gdb sudo apt-get install gdb-multiarch Run gdb-multiarch and check its version gdb-multiarch -v ? Should display ?rst line similar to the following GNU gdb Ubuntu - ubuntu If Running Ubuntu Normally you should be able to do an apt-get on gdb-multiarch however Ubuntu is packaged with gdb-multiarch version which is unable to correctly process core ?les from the target Here is the process to get gdb-multiarch which does work Remove any existing versions of GDB and GDB multi-architecture sudo apt-get remove gdb gdb-multiarch Add the Ubuntu utopic repository to etc apt sources list sudo gedit etc apt sources list ? At the end of the ?le add the following lines Added for GDB deb http old- releases ubuntu com ubuntu utopic main universe ? Note etc apt sources list is a protected ?le so must be root to edit it Use sudo to launch gedit as shown Update the packages available through the new repository sudo apt- get update Install GDB and GDB multi-architecture sudo apt-get install gdb sudo apt-get install gdb-multiarch ? You may need to use the ?? ?x ? option ?rst before the above commands will work sudo apt-get -f install Run gdb-multiarch and check its version gdb-multiarch -v ? Should display ?rst line GNU gdb Ubuntu - ubuntu -cvs Troubleshooting ? If you are having problems getting the correct version to install you can double check that apt-get is reading the correct repository to ?nd GDB version or better PDF Created CView GDB apt-cache showpkg gdb View GDB-Multiarchitecture apt- cache showpkg gdb-multiarch If the desired version of the package is not shown double check your sources list ?le re-run ??apt-get update ? PDF Created C GDB GDB is a text-debugger common to most Linux systems For remote debugging we'll run gdbserver on the target and the cross-debugger gdb-
Documents similaires
-
27
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Aucune attribution requise- Détails
- Publié le Fev 20, 2022
- Catégorie Industry / Industr...
- Langue French
- Taille du fichier 67.7kB