This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: info proc cmd
- From: Daniel Jacobowitz <drow at false dot org>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: gdb at sources dot redhat dot com
- Date: Sun, 9 Mar 2008 17:13:29 -0400
- Subject: Re: info proc cmd
- References: <umyp9i29x.fsf@gnu.org>
On Sat, Mar 08, 2008 at 06:55:22PM +0200, Eli Zaretskii wrote:
> There seems to be a bug in "info proc". The command line of the
> process is produced like this (in linux-nat.c):
Another bug in it; it accepts things which are neither pids nor
keywords. I thought at first you meant "info proc cmd" literally,
so I tried it, and it behaved just like info proc :-)
> This bug is easy enough to fix, but I wonder whether some older
> versions of Linux did use the one-string format, in which case fixing
> this to assume a set of null-terminated arguments would break those
> old systems.
>
> Does anyone has further insight into the history of this? Should I
> just go ahead and fix the code?
I think you can go ahead and fix it; it's been NUL separated for as
long as I can remember. The kernel actually reads memory from the
child to display this, and the memory is where the initial argv
strings were placed; there won't be any spaces unless the app put them
there with setproctitle.
--
Daniel Jacobowitz
CodeSourcery