GDB+GdbServer: ARM程序调试

嵌入式arm linux环境中gdb+gdbserver调试

建立交叉调试环境

编译过程中碰到的问题:

嵌入式 编译gdb源码时出现“set but not used [-Werror=unused-but-set-variable]”问题的解决办

gdbserver: linux-x86-low.c error: sys/reg.h: No such file or directory

gdbserver 调试时gdb运行c时崩溃不能正常调试

当使用gdb+gdbserver方式调试动态程序时,出现如下错误:

GDB: Unable to find dynamic linker breakpoint function.

解决方法:

set sysroot /absolute/path/to/copy/of/target/root/filesystem

我的方式:

set sysroot /workteam/yinguicai/data/rootfs/20a
target remote 10.15.3.199:1234
handle SIG32 nostop noprint
handle SIG33 nostop noprint

注意:如果是可执行程序是静态编辑则没有这个告警,但依然解决不了watch问题

(gdb) p &n
$2 = (int *) 0xbefdec70
(gdb) dis
(gdb) watch *((int *) 0xbefdec70)
Hardware watchpoint 2: *((int *) 0xbefdec70)
(gdb) c
Continuing.
Warning:
Could not insert hardware watchpoint 2.
Could not insert hardware breakpoints:
You may have requested too many hardware breakpoints/watchpoints.

交叉编译GDB工具, 使GDB运行在嵌入式板子上

Child terminated with signal = 5

Child terminated with signal = 0x5 (SIGTRAP)
GDBserver exiting

yinguicai@Cpl-IBP-Product:~/data/nfs$ ./arm-linux-gdb hicore_20a
GNU gdb (GDB) 7.3
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "--host=x86_64-unknown-linux-gnu --target=arm-linux".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /data1/data_yinguicai/nfs/hicore_20a...done.
warning: Remote failure reply: E01
warning: Unable to find dynamic linker breakpoint function.
GDB will be unable to debug shared library initializers
and track explicitly loaded dynamic code.
0x400a8e50 in ?? ()
(gdb) c
Continuing.
Cannot access memory at address 0x0
warning: Could not load shared library symbols for 9 libraries, e.g. /lib/libcrypt.so.0.
Use the "info sharedlibrary" command to see the complete listing.
Do you need "set solib-search-path" or "set sysroot"?

^C
Program received signal SIGINT, Interrupt.
0x40278f60 in ?? ()
(gdb) b gui_toplevel_handle_msg_syserror
Function "gui_toplevel_handle_msg_syserror" not defined.
Make breakpoint pending on future shared library load? (y or [n]) y
Breakpoint 1 (gui_toplevel_handle_msg_syserror) pending.
(gdb) c
Continuing.
Cannot access memory at address 0x0
^C
Program received signal SIGINT, Interrupt.
0x40278f60 in ?? ()
(gdb) b displaySingleAudio
Cannot access memory at address 0x0
Breakpoint 2 at 0x17767c: file dataManagement/audio/wavLoader.c, line 244.
(gdb) c
Continuing.

Program terminated with signal SIGTRAP, Trace/breakpoint trap.
The program no longer exists.
(gdb) bt
No stack.
(gdb) q

gdbserver多线程进不去

http://sourceware.org/gdb/wiki/FAQ#GDB_does_not_see_any_threads_besides_the_one_in_which_crash_occurred.3B_or_SIGTRAP_kills_my_program_when_I_set_a_breakpoint.

GDB+GdbServer: ARM程序调试的更多相关文章

  1. 用Eclipse和GDB构建ARM交叉编译和在线调试环境

    我们在 Linux 主机中搭建我们的开发环境,使用 Ubuntu 10.04 LTS 为例. 搭建应用开发环境   安装 JRE Eclipse 依赖于Java 环境,所以必须先安装 JRE 或 JD ...

  2. Eclipse-cdt 配合 gdbserver 进行 arm 程序远程调试 上

    做嵌入式Linux开发也不用再羡慕windows程序员VS集成开发环境的强大,我们同样能够搭建出给力的IDE. 今天在这里记录一下我使用Eclipse-cdt,gdb,gdbserver搭建远程arm ...

  3. GDB+GDBServer调试Linux应用程序

    参考:http://blog.csdn.net/shanghaiqianlun/article/details/7820401 一.gdb+gdbserver总体介绍 远程调试环境由宿主机GDB和目标 ...

  4. 嵌入式arm linux环境中gdb+gdbserver调试

    一.前言嵌入式Linux系统中,应用开发过程中,很多情况下,用户需要对一个应用程序进行反复调试,特别是复杂的程序.采用GDB方法调试,由于嵌入式系统资源有限性,一般不能直接在目标系统上进行调试,通常采 ...

  5. 在QEMU中调试ARM程序【转】

    转自:http://linuxeden.com/html/develop/20100820/104409.html 最近我想调试一个运行在QEMU模拟ARM系统中的Linux程序.我碰到过一些麻烦,因 ...

  6. Linux应用调试 :使用gdb和gdbserver进行远程调试

    一.引言 在日常程序开发中不免遇到类似空指针操作导致程序崩溃的问题,所以需要一定的手段去定位bug,而断点调试是普遍使用的技巧,比如Windows中用VC++的debug模式进单步运行.断点调试等,而 ...

  7. QT Creator 环境使用 remote debug 调试 arm 程序

    这里使用的 4.8.5 QTE 环境,之前尝试过远程使用 GDB 来调试板子上的 QT 程序,但是没成功.没有调试手段比较痛苦,今天又花了点时间,居然搞定了.粗做记录. 工具版本: 1. QtCrea ...

  8. arm linux 移植 gdb/gdbserver

    背景 调试工具gdb的使用对于嵌入式Linux开发人员来说是一项不可少的技能. 目前,嵌入式 Linux系统中,主要有三种远程调试方法,分别适用于不同场合的调试工作:用ROM Monitor调试目标机 ...

  9. GDB + gdbserver 远程调试android native code

    原文地址:GDB + gdbserver 远程调试android native code 作者:tq08g2z 以调试模拟器中的native library code为例. Host: ubuntuT ...

随机推荐

  1. 服务器Tomcat WAS JBoss

    做任何web项目,都离不开服务器,有钱的公司用WebSphere.WebLogic,没钱公司用nginx+tomcat,不要小瞧nginx+tomcat麻雀虽小,五脏俱全. 服务器的知识,在笔试.面试 ...

  2. Kali Linux WPScan更新到2.9.3

    Kali Linux WPScan更新到2.9.3   WPScan是Kali Linux内置的一款Web漏洞扫描工具,专门扫描WordPress模版构建的网站.该工具最近更新到2.9.3.在新版本中 ...

  3. 【UOJ #198】【CTSC 2016】时空旅行

    http://uoj.ac/problem/198 (先补一下以前的题解) 这道题5分暴力好写好调,链上部分分可以用可持久化线段树,每次旅行\(x\)值相同的可以用标记永久化线段树.我还听到某些神犇说 ...

  4. JavaWeb数据库配置

    项目结构 在 JDBC 中 DBUtil.java 加载配置文件时,路径使用的是Java项目的相对路径.存在本地的. // 加载配置文件 Properties p = new Properties() ...

  5. BZOJ 4883 [Lydsy2017年5月月赛]棋盘上的守卫(最小生成环套树森林)

    [题目链接] http://www.lydsy.com/JudgeOnline/problem.php?id=4883 [题目大意] 在一个n*m的棋盘上要放置若干个守卫. 对于n行来说,每行必须恰好 ...

  6. 【线段树】hihocoder 1586 ACM-ICPC国际大学生程序设计竞赛北京赛区(2017)网络赛 I. Minimum

    题意:给你一个序列(长度不超过2^17),支持两种操作:单点修改:询问区间中最小的ai*aj是多少(i可以等于j). 只需要线段树维护区间最小值和最大值,如果最小值大于等于0,那答案就是minv*mi ...

  7. bzoj 3312: [Usaco2013 Nov]No Change

    3312: [Usaco2013 Nov]No Change Description Farmer John is at the market to purchase supplies for his ...

  8. 设计BBS

    功能分析: 1 登陆功能(基于ajax,图片验证码) 2 注册功能(基于ajax,基于forms验证) 3 博客首页 4 个人站点 5 文章详情 6 点赞,点踩 7 评论 --根评论 --子评论 8 ...

  9. ListView EditText 实现的三种方式

    原文网址:http://blog.sina.com.cn/s/blog_682139d001013omd.html 这段时间搞一个android表格,真是搞死人,让我想到iphone开发是何其的简单啊 ...

  10. kong添加upstream

    整理的文档比较早,kong版本可能是0.10.3版本.详情请看官网最新文档 准备 使用kong代理后端请求 1.开放几个接口如下: 本地请求1:http://aaa.wyc.com:8888/aaa ...