On Wednesday, April 11 2018, Paul-Antoine Arras wrote: > Dear Maintainer, > > gdb incorrectly parses /proc/pid/cmdline, stopping at the first NUL > byte encountered with a warning. > > * Steps to reproduce: > > $ gdb --args /bin/ls -l > Reading symbols from /bin/ls...(no debugging symbols found)...done. > (gdb) b _start > Function "_start" not defined. > Breakpoint 1 (_start) pending. > (gdb) r > Starting program: /bin/ls -l > > Breakpoint 1, 0x00007ffff7dd9090 in _start () from > /lib64/ld-linux-x86-64.so.2 > (gdb) info proc > process 5618 > warning: target file /proc/5618/cmdline contained unexpected null characters > cmdline = '/bin/ls' > cwd = '/homes/parras' > exe = '/bin/ls' > > This happens for all command lines with arguments. > > The bug has already been fixed quite some time ago: > https://sourceware.org/ml/gdb-patches/2014-04/msg00204.html > Not sure why the Debian version still has it...
This patch was posted upstream, but it wasn't incorporated into the official repository until this year, when Andreas Arnez took it over and pushed it: commit 26d6cec4a9291f154e549fb6f4318ace6cfaa2a5 Author: Andreas Arnez <ar...@linux.vnet.ibm.com> Date: Thu Mar 22 10:02:18 2018 +0100 Make "info proc cmdline" show args on GNU/Linux The GDB version currently packaged in Debian is older and doesn't include this commit. -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/
Description: PGP signature