我正在尝试调试一个在处理请求时派生的进程。
我已经将follow-fork-mode设置为child,允许gdb在命中子对象中的断点时闯入。但是,当我继续从子进程中继续时,父进程就分离了。
很多文档都指向选项detach-on-fork,但是如果我尝试设置这个选项,我会得到:
(gdb) set detach-on-fork on
No symbol "detach" in current context.
该选项的链接清晰可见:
编辑:系统信息
>uname -a
Linux localhost 2.6.9-78.0.22.ELsmp #1 SMP Thu Apr 3
在我的linux机器上,计算一个比FLT_MAX大的浮子会导致无穷大,如下所示:
sacha@sacha-XPS13:~$ gdb
GNU gdb (GDB) 7.6.1-ubuntu
Copyright (C) 2013 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
我试图在64位Ubuntu系统上调试32位可执行文件.它本身在命令行中运行良好,但是当我尝试使用gdb时,它挂在ld-linux.so.2中。此外,gdb适用于可执行文件的64位版本。有人知道我该试试什么吗?
我刚刚将一台机器重新映射到Ubuntu18.04.3,并安装了gcc和g++的多库版本。
提前谢谢。
gdb <executable>
GNU gdb ...
This GDB was configured as "x86_64-linux-gnu"
...
Reading symbols from <executable>...done.
(gd
我不擅长英语,对此我很抱歉。现在,有一个关于我何时用GDB调试samba的问题。
# gdb /usr/local/samba/sbin/smbd
GNU gdb Red Hat Linux (5.2.1-4)
Copyright 2002 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it
当按照通常的方式运行时,gdb会像预期的那样停止:
(gdb) break main
(gdb) run
Starting program ...
Breakpoint 1, main ...
在管道运行时,gdb从不停止:
(gdb) run | cat
Starting program: /home/sds/z | cat
...
During startup program exited normally.
(gdb)
如何调试管道时的程序行为?
我的设置:
$ gdb --version
GNU gdb (GDB) Amazon Linux (7.6.1-64.33.amzn1)
$
我用以下方法为arm编译了gdbserver 7.6:
cd /gdb-7.6-src/gdb/gdbserver
./configure --target=arm-linux --host=arm-linux
make CC=/path/to/cross-compiler-gcc
然后,我为arm编译了gdb 7.6,并使用:
cd /gdb-7.6-src/
./configure --target=arm-linux --prefix=/opt/gdb-arm/install/
make && make install
我用以下方法编译了我的琐碎应用程序:
/path/t
我安装了libc6 & libc6-dbg。
(gdb) b
reak freeifaddrs
(gdb) run
Breakpoint 1, __freeifaddrs (ifa=0xa822e0) at ../sysdeps/unix/sysv/linux/ifaddrs.c:840
840 ../sysdeps/unix/sysv/linux/ifaddrs.c: No such file or directory.
(gdb) list
835 in ../sysdeps/unix/sysv/linux/ifaddrs.c
(gdb) disassemble
Dump of a
我有一个程序,当我从终端(没有GDB)运行时,它会打印一些输出。假设输出如下所示
welcome to CMP simulator
initializing
finish initialization
now run
goodbye
现在,当我想使用GDB时,程序会给出一个PID,我用它来连接GDB。假设程序的输出现在如下所示
welcome to CMP simulator
gdb - 5932 (Run this command on another terminal and type "continue" at GDB prompt)
当程序等待SIGCONT时,我
我有一个C程序,它编写了一个非常复杂的脚本来运行它。我需要使用gdb来调试这个程序。我尝试运行这个脚本并将gdb附加到它的进程中,但是我无法设置我需要的断点:
$ gdb median.o 27944
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free softwa
我在ubuntu12.04中使用android-ndk-r9d-linux-x86的ndk来调试android本机应用程序"hello-jni",但是它收到了这个错误。
WARNING: The shell running this script isn't bash. Although we try to avoid bashism in scripts, things can happen.
.../adt-bundle-linux-x86-20140321/android-ndk-r9d/ndk-gdb: 143: .../a
我正在尝试远程调试Linux的内核。我已经创建了一个VM (使用VMware),并使用gdb从我的PC连接到它,一切正常。
问题是gdb无法加载vmlinux-gdb.py脚本。我尝试在gdb上使用source命令添加它,但得到以下错误:
Traceback (most recent call last):
File "~/workspace/kernels/default-kernel/scripts/gdb/vmlinux-gdb.py", line 28, in <module>
ImportError: No module named 'linu
我正在使用Windows Subsystem for linux使用VS Code来调试'C‘代码。我基本上是想用一个基于linux的编译器来编译“C”代码。我已经在Visual Studio Code中将默认终端设置为'WSL‘。单击调试按钮后,我收到以下错误消息:“Unable to start debubug.the value of miDebuggerPath is invalid”我确认'gdb‘已安装在Windows Subsystem for Linux中,并且它的可执行文件(ELF文件)位于'/usr/bin/gdb’位置
这是m launch
我不知道为什么在设置断点之后,GDB不能正常工作:
[jalal@mumble-36] (2)$ gdb --args ./server 200000 img
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-60.el6_4.1)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are
代码(m1.cpp):
#include <iostream>
using namespace std;
int main (int argc, char *argv[])
{
cout << "running m1" << endl;
return 0;
}
GDB版本: GNU gdb (GDB) 7.6.2
使用:g++ -g m1.cpp构建
命令行历史记录:
(gdb) b main
Breakpoint 1 at 0x40087b: file m1.cpp, line 6.
(gdb) r
Starting pro
我试图在RT上调试一个多线程应用程序。在普通Linux上,应用程序运行良好,GDB也运行良好。在RT Linux上,应用程序运行良好,但在GDB下,应用程序运行几秒钟,然后终止并打印:
Program terminated with signal SIGTRAP, Trace/breakpoint trap. The program no longer exists.
我无法进行回溯,也无法确定是什么导致了问题。我怀疑这可能是gdb使用的一些库,或者可能是应用程序中的内存损坏。
我创建了60多个线程,更多的线程是由各种看门狗和计时器创建的。到目前为止,我已经尝试过:
检查libp线程.so
我正在用RHEL7构建我的ProC代码,并将其部署到RHEL6服务器。它工作得很好,但是我不能正确地使用gdb。它说-“单步执行直到退出函数,它没有行号信息。”
如果我在RHEL7服务器上部署,我不会看到这个错误,我可以逐行执行gdb。
gdb在RHEL6中部署的app中运行时:
$> gdb progname
GNU gdb (GDB) Red Hat Enterprise Linux (7.2-92.el6)
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or l
我试图用gdb调试一个名为xdf的程序,但当我运行gdb xdf时,我得到了以下错误:
"/home/nealtitusthomas/X-ray_astronomy/heasoft-6.24/x86_64-pc-linux-gnu-libc2.27/bin/xdf": not in executable format: File format not recognized
该程序以符号方式链接,file /home/nealtitusthomas/X-ray_astronomy/heasoft-6.24/x86_64-pc-linux-gnu-libc2.27/bin/xdf的