From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id BDD7A3858D37 for ; Sat, 26 Aug 2023 06:46:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BDD7A3858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZn40-0008Gb-6Q; Sat, 26 Aug 2023 02:46:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=VmQgYjCLrmR4fZRx7qOekbpg5tyRpzfEunnaXb5do34=; b=HrS+hMhPJYtw 63OB+QPiTJ5/S+BxRW0i8uh/qmd3EeBMS84LDhMPioApbwD6H0cj0Zb1i0h98oQGFhy3dMeVisSpH 0Tsd4r7FriGkHVrZgw4pvKal992azNN0p479Ok7sFIZMdrAGNOeYUm0qiZY0QvrZjqHc/J/EEwFS1 CBMJ9f0nB3TMoNcitFqh95GuMmAw+Q2fnOr1ZemgrxtDPu27lr7ent5AL2315HW9l3N4I0sT7TMII 2jaitQ3nyGVVDy+wtWMbmNUoegT/UnzYFHu73WGUY5OsvS4CIuACDd+hwWfah+CBiGlGXyCmwRKo5 wchoiE+Ed/kW9IMCGzAe0A==; Date: Sat, 26 Aug 2023 09:46:56 +0300 Message-Id: <83h6ommhb3.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess Cc: gdb-patches@sourceware.org In-Reply-To: (message from Andrew Burgess on Fri, 25 Aug 2023 16:34:37 +0100) Subject: Re: [PATCHv2 04/10] gdb/gdbserver: add new qDefaultExecAndArgs packet References: X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > From: Andrew Burgess > Cc: Andrew Burgess , > Eli Zaretskii > Date: Fri, 25 Aug 2023 16:34:37 +0100 > > diff --git a/gdb/NEWS b/gdb/NEWS > index c4b1f7a7e3b..d78929c1398 100644 > --- a/gdb/NEWS > +++ b/gdb/NEWS > @@ -105,6 +105,14 @@ > 'inferior' keyword with either the 'thread' or 'task' keywords when > creating a breakpoint. > > +* When connecting to a remote server, if the server supports the > + qDefaultExecAndArgs packet, then GDB will copy the argument string > + from the server and update the 'args' setting, as if 'set args ...' > + had been used. This means that the arguments are visible from GDB > + using 'show args', and that, if using the extended-remote protocol, > + subsequent runs of the inferior will use the same arguments as the > + first run. > + > * New commands > > set debug breakpoint on|off > @@ -278,6 +286,13 @@ info main > inferior specific, then this field contains None. This field can > be written too. > > +* New remote packets > + > +qDefaultExecAndArgs > + This packet returns the executable filename and argument string with > + which the server was started. If no such information was given to > + the server then this is reflected in the reply. > + > *** Changes in GDB 13 > This part is OK. > +@item S;@var{PP@dots{}};@var{AA@dots{}} > +The program filename provided to the remote server when it started was > +@var{PP@dots{}}, which is a hex encoded string, and the argument > +string passed to the program when started by the server was > +@var{AA@dots{}}, which is also a hex encoded string. Here, PP and AA don't stand for literal "PP" and "AA" strings, they stand for 2 or more hex-encoded characters, right? In that case, PP and AA should be in lower-case. Moreover, I question the need to use such cryptic names; why not say something like this instead: @item S;@var{prog};@var{args} The program filename provided to the remote server when it started was @var{prog}, which is a hex encoded string of zero or more characters, and the argument string passed to the program when started by the server was @var{args}, which is also a hex encoded string. IOW, what is the significance of using two characters in PP and AA? Reviewed-By: Eli Zaretskii