From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 100983 invoked by alias); 22 Mar 2018 11:18:15 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 100887 invoked by uid 89); 22 Mar 2018 11:18:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=suite X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 22 Mar 2018 11:18:13 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w2MBI7x9002478 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 22 Mar 2018 07:18:11 -0400 Received: by simark.ca (Postfix, from userid 112) id 17E651E782; Thu, 22 Mar 2018 07:18:07 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 500821E030; Thu, 22 Mar 2018 07:18:06 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 22 Mar 2018 11:18:00 -0000 From: Simon Marchi To: Andreas Arnez Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH] Make "info proc cmdline" show args on GNU/Linux In-Reply-To: References: Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.4 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 22 Mar 2018 11:18:07 +0000 X-IsSubscribed: yes X-SW-Source: 2018-03/txt/msg00414.txt.bz2 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