Compile and install gdb+insight and gdbserver remote debugging

Source: Internet
Author: User
Tags bz2
Compile and install gdb+insight and gdbserver remote debugging arm Development Board native application

Download gdb-6.8.tar.bz2
http://ftp.cs.pu.edu.tw/Linux/sourceware/gdb/releases/
A. Compile and install GDB
<1>luther@gliethttp:~/gdb-6.8$./configure--target=arm-linux--enable-sim--prefix=/usr/local
<2>luther@gliethttp:~/gdb-6.8$ make
<3>luther@gliethttp:~/gdb-6.8$ sudo make install
Two. Compile and install Gdbserver
<1>luther@gliethttp:~/gdb-6.8/gdb/gdbserver$./configure--target=arm-linux--host=arm-linux
<2>luther@gliethttp:~/gdb-6.8/gdb/gdbserver$ make
Or make CC=/USR/LOCAL/ARM-LINUX/BIN/ARM-LINUX-GCC specify the compiler directory
<3> this generates a gdbserver executable file in the Gdb-6.8/gdb/gdbserver directory and copies it to
On the target Development Board.
Three. Test Arm-linux-gdb + gdbserver
In minicom or putty input: [192.168.100.1 for PC IP address, 2345 for listening port]
<1>gdbserver 192.168.100.1:2345 Hello
Input on PC: [192.168.100.2 for Development Board IP address]
<2>luther@gliethttp:~/arm-linux-gdb Hello then enter
Target Remote 192.168.100.2:2345
This allows you to see the following message on the Development Board minicom or putty:
/#./gdbserver 192.168.100.1:2345 Hello
Process WPA_CLI created; PID = 730
Listening on port 2345
Remote Debugging from Host 192.168.100.1
=====================================================================
Specific examples are as follows:
=====================================================================
PC side log or using Arm-linux-gdbtui simple graphics GDB terminal
luther@gliethttp:~/arm$ arm-linux-gdb Hello
GNU GDB 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License gplv3+: GNU GPL version 3 or later This is the free software:you are and redistribute it.
There is NO WARRANTY and to the extent permitted by. Type "Show copying"
and "Show warranty" for details.
This is GDB was configured as "--host=i686-pc-linux-gnu--target=arm-linux" ...
(GDB) Target remote 192.168.100.2:2345
Remote Debugging using 192.168.100.2:2345
[New Thread 1514]
Warning:unable to find dynamic linker breakpoint function.
GDB would be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x400007e0 in?? ()
(GDB) B main
Breakpoint 1 at 0x835c:file hello.c, line 6.
(GDB) L
1 #include <stdio.h>
2
3 int main (int argc, char *argv[])
4 {
5 int i;
6 for (i = 0;i < 10;i++)
7 {
8 printf ("%d/n", I);
9}
Ten return 0;
(GDB) C do not enter R, enter C because the target's Hello is in run state at load-back.
Continuing.
Warning:. Dynamic section for "/lib/libc.so.6" isn't at the expected address (wrong library or version mismatch?)
Error While mapping shared library sections:
/lib/ld-linux.so.3:no such file or directory.

Breakpoint 1, Main (argc=1, argv=0xbeb4ad84) at Hello.c:6
6 for (i = 0;i < 10;i++)
(GDB) n
8 printf ("%d/n", I);
(GDB) n
6 for (i = 0;i < 10;i++)
(GDB) n
8 printf ("%d/n", I);

(GDB)
=====================================================================
Target Board End Log
/#./gdbserver 192.168.100.1:2345 Hello
[3688.476398] init:untracked PID 1513 exited
Process Hello created; PID = 1514
Listening on port 2345
Remote Debugging from Host 192.168.100.1
0

=====================================================================
You can also use Ddd-debugger arm-linux-gdb Hello graphical debugging,
The insight needs to be compiled from the source code:
<1> Download Source insight-6.8.tar.bz2
http://sourceware.org/insight/
<2>luther@gliethttp:~/insight-6.8$./configure--target=arm-linux--enable-sim--prefix=/usr/local
<3>luther@gliethttp:~/insight-6.8$ make
<4>luther@gliethttp:~/insight-6.8$ sudo make install
Compiled in the insight pairing of Gdbserver
<1>luther@gliethttp:~/insight-6.8/gdb/gdbserver$./configure--target=arm-linux--host=arm-linux
<2>luther@gliethttp:~/insight-6.8/gdb/gdbserver$ make
Start Arm-linux-insight because the arm-linux-insight relies on GDB, so the ARM-LINUX-GDB is automatically compiled.
=====================================================================
Specific examples are as follows:
luther@gliethttp:~/arm$ Arm-linux-insight
Ide_initialize_paths Failed:can ' t find the GUI TCL library in the following directories:
/home/usr/share/redhat/gui/home/share/redhat/gui/share/redhat/gui/usr/local/libgui/library/home/usr/share/ Redhat/ide/home/share/redhat/ide/share/redhat/ide/usr/local/libide/library
Later found in the/usr/local/arm-linux/bin directory
lrwxrwxrwx 1 root 2008-02-03 11:00 arm-linux-insight-> arm-iwmmxt-linux-gnueabi-insight
-rwxr-xr-x 1 root root 16M 2008-02-03 11:00 arm-iwmmxt-linux-gnueabi-insight
Just get rid of it, okay?
=====================================================================

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.