From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 60018 invoked by alias); 13 Feb 2020 13:34:31 -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 60007 invoked by uid 89); 13 Feb 2020 13:34:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-16.8 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 spammy=PROGRAM, 0200, HX-Languages-Length:1313 X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 13 Feb 2020 13:34:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581600867; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UgBDIdsy9tmVavwgGapG7AbYcelr9HFIX9dSzvB5HZA=; b=DaMKy5p66dJ3xDVf3JB3oO1A6rzrdp7VeWgyLm2HDYLFC4ZXDuGV0JZE6gog7/wGpWHb5y TxYKxA0Dck39vnq727u07nd4a5YJxZsTxiw2mUaepwzdP6+O0G8/1SF1yiDiQI6oZJoxlk g1GFb5S6Yg4B4WEh6QVnnII28F/pVBw= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-394-9R7axXUaORm_BJSHogAbhQ-1; Thu, 13 Feb 2020 08:34:26 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1B91E107ACC4; Thu, 13 Feb 2020 13:34:25 +0000 (UTC) Received: from f31-4.lan (ovpn-116-54.phx2.redhat.com [10.3.116.54]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1C1E826FAA; Thu, 13 Feb 2020 13:34:23 +0000 (UTC) Date: Thu, 13 Feb 2020 13:34:00 -0000 From: Kevin Buettner To: gdb-patches@sourceware.org Cc: Eli Zaretskii Subject: Re: [PATCH] Fix program invocation by gdbserver on MS-Windows Message-ID: <20200213063423.17c7de33@f31-4.lan> In-Reply-To: <83y2v1vd0i.fsf@gnu.org> References: <83y2v1vd0i.fsf@gnu.org> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2020-02/txt/msg00499.txt.bz2 On Tue, 24 Dec 2019 19:39:41 +0200 Eli Zaretskii wrote: > gdbserver doesn't construct the command-line correctly when it invokes > programs on MS-Windows. For example, if you invoke > > gdbserver :9999 etags.exe --help > > and then connect from GDB and run the inferior, you will see: > > Remote debugging from host 127.0.0.1, port 3546 > --help: no input files specified. > Try '--help --help' for a complete list of options. > > Child exited with status 1 > > Which means that (a) the program exited abnormally; and (b) it > received "--help" in argv[0]. > > This is because the way we construct the command line in win32-low.c > is incorrect: we should prepend the program's name to the arguments. > > The patch below does that. OK to commit it? > > diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog > index 028d1e9..29de8b6 100644 > --- a/gdb/gdbserver/ChangeLog > +++ b/gdb/gdbserver/ChangeLog > @@ -1,3 +1,10 @@ > +2019-12-24 Eli Zaretskii > + > + * win32-low.c (create_process): Prepend PROGRAM to ARGS when > + preparing the command line for CreateProcess. > + (win32_create_inferior): Reflect the program name in debugging > + output that shows the process and its command line. > + LGTM. Kevin