This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Disable check for NUL bytes in /proc/pid/cmdline


On 04/11/2014 03:28 PM, Vladimir Nikulichev wrote:
> When I execute gcore on a process, it prints warning that 
> /proc/pid/cmdline
> contains null characters:
> 
> $ gcore 18706
> [Thread debugging using libthread_db enabled]
> Using host libthread_db library "/lib64/libthread_db.so.1".
> 0x00007fa23be3c5c3 in __select_nocancel () from /lib64/libc.so.6
> warning: target file /proc/18706/cmdline contained unexpected null 
> characters
> Saved corefile core.18706
> 
> There's nothing wrong, null characters separate command line arguments 
> from
> each other. This fix disables the check when reading cmdline.

This also affects "info proc cmdline", which ignores all arguments
but the first.  Seems to me we should stop thinking of cmdline
as a single string at all, thus read it with
target_fileio_read_alloc as one block, and then "parsing" the
result, extracting/printing all arguments.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]