[PATCH] Make "info proc cmdline" show args on GNU/Linux

Simon Marchi simon.marchi@polymtl.ca
Thu Mar 22 11:18:00 GMT 2018


On 2018-03-22 05:04, Andreas Arnez wrote:
>>> 
>>> +# 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?

Yes, they probably should.

>> 
>>> +    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.

Thanks!

Simon



More information about the Gdb-patches mailing list