Gdb+gdbserver debugging in embedded ARM Linux environment

Source: Internet
Author: User
Tags ftp gettext

Using the GdB method debugging, because of the limited resources of embedded system, it can not be debugged directly on the target system, which is usually debugged by Gdb+gdbserver. The target system must include the Gdbserver program, and the host must also install the GDB program. Here we are not directly using the Linux distribution with GDB, need to cross compile gdb and gdbserver.

A Objective

Embedded Linux system, in the application development process, in many cases, users need to be repeated debugging an application, especially complex programs. Using the GdB method debugging, because of the limited resources of embedded system, it can not be debugged directly on the target system, which is usually debugged by Gdb+gdbserver. Gdbserver is running on the target system and GDB is running on the host.

The target system must include the Gdbserver program, and the host must also install the GDB program. Here we are not directly using the Linux distribution with GDB, need to cross compile gdb and gdbserver.

Two Compiling GDB and Gdbserver tools

Download the latest version of the gdb-6.8.tar.gz, you can download to ftp://ftp.gnu.org/gnu/gdb.

Prepare your own working directory, as shown below

/home/user/gdb

|--gdb-6.8

|--obj-gdb

|--build

|--obj-gdbserver

|--build

|--bin

The script Obj-gdb/build reads as follows:

#!/bin/sh

.. /gdb-6.8/configure--target=arm-linux--enable-shared--prefix=/usr/src/arm/gdb/build-gdb--without-x-- DISABLE-GDBTK--disable-tui--without-included-regex--without-included-gettext

Make

echo "Done"

The script Obj-gdbserver/build reads as follows:

#!/bin/sh

cc=/opt/toolchain/arm-linux/bin/arm-linux-gcc

.. /gdb-6.8/gdb/gdbserver/configure--host=arm-linux--without-included-regex--without-included-gettext

echo "Done"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.