From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by sourceware.org (Postfix) with ESMTPS id 9FC83386F81E for ; Tue, 12 May 2020 16:00:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 9FC83386F81E Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id DD799160061 for ; Tue, 12 May 2020 18:00:36 +0200 (CEST) Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 49M2Zr3K2gz9rxf; Tue, 12 May 2020 18:00:36 +0200 (CEST) Subject: Re: [PATCH 2/4] gdbserver: Don't add extra NULL to program args To: Simon Marchi , gdb-patches@sourceware.org References: <20200429111638.1327262-1-m.weghorn@posteo.de> <20200429111638.1327262-4-m.weghorn@posteo.de> <859daf15-0142-5d78-4c35-594f104fba6b@simark.ca> From: Michael Weghorn Message-ID: <0ac5001f-cf46-fbff-17c5-8e4fc846bc89@posteo.de> Date: Tue, 12 May 2020 18:00:35 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <859daf15-0142-5d78-4c35-594f104fba6b@simark.ca> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 May 2020 16:00:40 -0000 On 07/05/2020 21.54, Simon Marchi wrote: > On 2020-04-29 7:16 a.m., Michael Weghorn via Gdb-patches wrote: >> The vector holding the program args is passed as a parameter >> to target_create_inferior, which then passes it to >> stringify_argv for all platforms, where any NULL entry in >> the vector is ignored, so there seems to be no reason >> to actually add one after all. >> >> (Since the intention is to replace uses of stringify_argv with >> construct_inferior_arguments in a follow-up commit and that >> function doesn't currently handle such NULL arguments, it >> would otherwise have to be extended.) > > Thanks, this LGTM. I actually missed another occurence where the same was done and have removed that as well in the next version: https://sourceware.org/pipermail/gdb-patches/2020-May/168348.html This was the cause of the segfault you had encountered and mentioned for the next patch. Michael