Tag: GDB

如何在Docker中安装和使用gdb?

我在docker中使用了下面的代码,但没有奏效 RUN mkdir gdb-build ;\ cd gdb-build;\ wget http://ftp.gnu.org/gnu/gdb/gdb-7.11.tar.xz;\ tar -xvf gdb-7.11.tar.xz;\ cd gdb-7.11;\ ./configure –prefix=/usr;\ make;\ make -C gdb install;\ cd ..;\ rm -rf gdb-build/; 但它说,当我运行它的输出是这样的: Connecting to ftp.gnu.org (208.118.235.20:80) gdb-7.11.tar.xz 0% | | 182k 0:01:40 ETA gdb-7.11.tar.xz 5% |* | 1060k 0:00:32 ETA gdb-7.11.tar.xz 10% |*** | 1876k 0:00:26 ETA gdb-7.11.tar.xz 14% |**** […]

在docker环境中,gdb attach id .attach:没有这样的文件或目录,程序正在被debugging。 杀了它? (Y或n)

在docker环境下,使用gdb attach来debuggingcpu的占用率过高,但inputgdb attach的进程id,提示如下:attach:没有这样的文件或目录。 附加到进程12804 / usr / bin / tawtsdbd:没有这样的文件或目录。 一个程序正在被debugging。 杀了它? (Y或n)n我发现/ proc /没有对应12804的id列表,search了很多方法没有解决,谁用docker在gdb下debugging过? 我们期待着您的回答

在docker容器中安装openssh-server,g ++,gdb和gdbserver Visual C ++ for Linux Development + Docker

我想在Docker容器中安装Visual C ++ for Linux Development的依赖关系,即openssh-server , g++ , gdb和gdbserver 。 我运行一个基于Ubuntu镜像的docker容器我已经尝试过ubuntu:14.04 , ubuntu:12.04和ubuntu:latest 。 我以交互模式运行容器并使用bash尝试安装依赖项。 上面链接的Visual C ++ for Linux页面表明依赖关系可以安装在… sudo apt-get install openssh-server g++ gdb gdbserver 不过,我安装时遇到了问题。 例如,当我尝试安装gdb我得到一个错误,指出该包无法find… root@f6de8c642ffa:/# apt-get install gdb Reading package lists… Done Building dependency tree Reading state information… Done E: Unable to locate package gdb 我也尝试用sudo加前缀,没有运气。 我得到类似的错误的其他包,除了我相信安装的g ++。 我假设这些用于C […]

Visual C ++ for Linux Development + Docker

我想通过在Docker容器中构build和debugging来开发Linux C ++应用程序。 我打算使用Visual C ++ for Linux Development来远程debugging到容器中。 然而,这个Visual Studio扩展最初是为了与Linux VM一起使用的,Linux开发和Docker对于我来说是新的,而且我对设置它的基础知识稍有困惑。 我创build了一个ubuntu:14.04 docker容器,并在容器中安装了Visual C ++ for Linux依赖项,即openssh-server , g++ , gdb和gdbserver 。 我已经承诺容器,创造一个图像工作。 我想我现在需要运行容器打开一个端口,以便我可以从Visual Studio连接到容器。 这是怎么做的? 容器是否需要进一步设置,以便有某种处理程序来处理将要打开的端口上的通信? 比如Bash是否需要分配来处理通过端口的通信? 还是有一个依赖关系,也许openssh-server ,需要分配来处理通过端口的通信? 或者是当我安装的依赖关系设置的东西? 如果是这样的端口? 在Visual C ++ for Linux开发指令中,它显示当连接到虚拟机时,可以提供诸如Host name , Port , User name , Authentication type和Password Authentication type凭证。 自然港将是必需的,但其他人将被要求? 如果是的话,这些凭据需要在Ubuntu容器中设置或以某种方式发现? 如果这样怎么样?

为ptrace_scope禁用Docker的AppArmor

是否有可能为特定的Docker容器禁用AppArmor? 我想使ptrace可访问,所以我可以将gdb附加到正在运行的进程,但是当我想更改设置时遇到以下问题: root@fbf728150308:/gopath# echo 0 > /proc/sys/kernel/yama/ptrace_scope bash: /proc/sys/kernel/yama/ptrace_scope: Read-only file system

gdb无法附加到进程

这是我正在使用的操作系统: Linux securecluster 4.9.8-moby#1 SMP Wed Feb 8 09:56:43 UTC 2017 x86_64 x86_64 x86_64 GNU / Linux 当试图以挂接用户的身份挂接gdb时,我得到了以下结果: Attaching to process 9636 Could not attach to process. If your uid matches the uid of the target process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf ptrace: […]

GDB使用gunicorn核心转储空回溯

我试图在一个docker容器中做一个gunicorn的核心转储,并在另一个容器中进行debugging。 Gunicorn运行python3.5。 当我在转储的容器中打开核心文件时,一切都很正常: Reading symbols from /opt/pyenv/versions/3.5.0/bin/python3.5…done. [New LWP 786] [Thread debugging using libthread_db enabled] Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1". Core was generated by `/opt/pyenv/versions/3.5.0/bin/python3.5'. #0 0x00007f7caec93af3 in __epoll_wait_nocancel () at ../sysdeps/unix/syscall-template.S:81 81 ../sysdeps/unix/syscall-template.S: No such file or directory. (gdb) bt #0 0x00007f7caec93af3 in __epoll_wait_nocancel () at ../sysdeps/unix/syscall-template.S:81 #1 0x00007f7cacdaf213 in pyepoll_poll (self=0x7f7ca5aa9a80, args=<optimized out>, […]

为什么GDB不能停在断点?

我用这个简单的代码来testing我的GDB(GNU gdb(Ubuntu 7.11.1-0ubuntu1〜16.04)7.11.1),我的linux在Docker中运行,代码是: // hello.cc #include <iostream> int main() { std::cout << "hello world!" << std::endl; } 我编译它: $ g++ -g -o out.a hello.cc 并debugging它像: (gdb) file out.a (gdb) b main Note: breakpoint 1 also set at pc 0x40084a. (gdb) info b Num Type Disp Enb Address What 1 breakpoint keep y 0x000000000040084a in main() […]

composer php没有看到GD扩展

我已经在Docker机器上安装了GD,如https://hub.docker.com/_/php/所述: RUN apt-get update && apt-get install -y \ libfreetype6-dev \ libjpeg62-turbo-dev \ libmcrypt-dev \ libpng12-dev \ && docker-php-ext-install -j$(nproc) iconv mcrypt \ && docker-php-ext-configure gd –with-freetype-dir=/usr/include/ –with-jpeg-dir=/usr/include/ \ && docker-php-ext-install -j$(nproc) gd 适用于PHP 7和PHP 5.6。 它工作没有问题(我可以操纵图像),但我现在想安装一些需要"ext-gd": "*",composer php包,问题是这样的: php -m 显示gd加载但是 composer show -p 不显示ext-gd所以我不能安装我需要使用composer php的软件包。 有什么办法可以安装GD让Composer看到它? 我在这里发现了类似的问题: https : //github.com/composer/composer/issues/4353,但是没有解决就closures了。 另外composer php依赖,说明没有php-xsl没有解决。 作为参考,我已经validation了Homestead,那里的composer […]

用gdb或cgdbdebuggingdocker deamon

我一直在尝试debugging,并在主机操作系统(ubuntu 14.04 OS)上运行的Ubuntu 14.04容器上使用gdb或cgdb进入cgdb守护进程代码。 在构build容器中的debugging二进制文件时,我使用了-O0 -g标志。 在容器中使用的版本: # go version go version go1.4.3 linux/amd64 我无法通过使用cgdb的代码: <http://www.gnu.org/software/gdb/documentation/>. For help, type "help". Type "apropos word" to search for commands related to "word"… Reading symbols from bundles/1.9.0-dev/dynbinary/docker…done. ( gdb) b main.handleGlobalDaemonFlag Breakpoint 1 at 0x497b30 (gdb) r daemon -D Starting program: /go/src/github.com/docker/docker/bundles/1.9.0-dev/dynbinary/docker daemon -D [Thread debugging using libthread_db […]