From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: Simon Marchi <simon.marchi@ericsson.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Make "info proc cmdline" show args on GNU/Linux
Date: Thu, 22 Mar 2018 09:04:00 -0000 [thread overview]
Message-ID: <m3po3wv5v4.fsf@oc1027705133.ibm.com> (raw)
In-Reply-To: <bfc92550-5c54-4a29-4186-76b944187c47@ericsson.com> (Simon Marchi's message of "Wed, 21 Mar 2018 15:27:46 -0400")
On Wed, Mar 21 2018, Simon Marchi wrote:
> On 2018-03-21 09:15 AM, Andreas Arnez wrote:
>> Currently "info proc cmdline" on GNU/Linux does not show the full command
>> line, but only argument 0. And even a warning is shown if there are more.
>> This was discussed in 2014 already:
>>
>> https://sourceware.org/ml/gdb-patches/2014-04/msg00212.html
>>
>> Follow the advice there and avoid target_fileio_read_stralloc. Instead,
>> use target_fileio_read_alloc to read the whole command line and then
>> replace NUL characters by spaces. Also add an appropriate test case.
>> Note that gdbserver already handles this correctly.
>
> Hi Andreas,
>
> This LGTM with two minor nits:
>
[...]
>>
>> +# Set command line arguments to be verified later with "info proc
>> +# cmdline". However, if we're using a stub, then "set args" would not
>> +# have any effect, so then just skip this.
>> +
>> +set cmdline ""
>> +if { ! [target_info exists use_gdb_stub] } {
>
> The use_gdb_stub proc from lib/gdb.exp should be used instead (its comment
> explains why).
Ah, OK. There are still some occurrences of "target_info exists
use_gdb_stub" in the test suite. Should these be replaced as well?
>
>> + set cmdline "-i foo bar -o baz 1234"
>> + gdb_test_no_output "set args $cmdline" "set args"
>> +}
>> +
>> if { ! [ runto_main ] } then {
>> untested "could not run to main"
>> return -1
>> @@ -50,6 +60,9 @@ gdb_test "info proc mapping" \
>> "info proc mapping"
>>
>> if {[istarget "*-*-linux*"]} {
>> + if { $cmdline != "" } {
>> + gdb_test "info proc cmdline" "cmdline = \'.* $cmdline\'"
>
> The backslashes are unnecessary.
Right.
Thanks for your review. Pushed with these fixes.
--
Andreas
next prev parent reply other threads:[~2018-03-22 9:04 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-21 13:15 Andreas Arnez
2018-03-21 19:28 ` Simon Marchi
2018-03-22 9:04 ` Andreas Arnez [this message]
2018-03-22 11:18 ` Simon Marchi
2018-03-22 18:46 ` Andreas Arnez
2018-03-22 20:12 ` Simon Marchi
2018-03-23 10:02 ` Andreas Arnez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3po3wv5v4.fsf@oc1027705133.ibm.com \
--to=arnez@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@ericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).