From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 85F03384477A for ; Mon, 15 Apr 2024 18:21:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 85F03384477A Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 85F03384477A Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713205271; cv=none; b=r7sqq3DlysYoMQI2yyEl5tgLe/LJNJl0YIFDfU9toSZw74z4AZwjj7BJN4Wasza2GJUnWwGUh2r5rMWrFkJOU5L7fjkbab2fr8WZDJ2xM+fkaJipSW9ngylxQxJtslsTLe9zyQ+hWNzFcpcYx3gUVtOYTTJUjgeo1n7BgN7PKP0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713205271; c=relaxed/simple; bh=0foEKsBoLvxP/kxloYN49gjUc4OroI8n9U5e0MTT0Fc=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=OpEXn5qJm0YwFmn4Ph6/tMs2qvrcjGuPhAsux+hoeSHGTtf453A/jukRTH1h9MZqU7G+EF+fX/34/IRU6ITrKx8aOnkC4lynbMpjCw/niuuqT3h/vqxAsW2/0eUkfXwrjHJD9O9Rm3LJz7aJcjCuB8d+HYVL92M7K9Dx4gjREF4= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1713205269; bh=0foEKsBoLvxP/kxloYN49gjUc4OroI8n9U5e0MTT0Fc=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=bkj3CGyW6aqe2t+TXT05/0kZlvKoV0QHfvCnQiS88J8WFwslnUbH08eBN+PJNIKYd thJfHX5jYXiJ/uf3y/4c4qdrLRc25kUGFAXtPKvEyeMeKAdZ2zkIwefoUGTJ93TGoK pVTd4xrkLbOBoQJakdKErkAZz/ED3MmRfHNL0VXk= Received: from [172.16.0.192] (192-222-143-198.qc.cable.ebox.net [192.222.143.198]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 9B8451E030; Mon, 15 Apr 2024 14:21:08 -0400 (EDT) Message-ID: <67ad3a03-2904-4bdd-b297-91c0ecd6fa4b@simark.ca> Date: Mon, 15 Apr 2024 14:21:07 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PP?] [PATCH] Strip trailing newlines from input string To: Tom Tromey , gdb-patches@sourceware.org Cc: =?UTF-8?Q?K=C3=A9vin_Le_Gouguec?= References: <20240408171818.1856529-1-tromey@adacore.com> Content-Language: fr From: Simon Marchi In-Reply-To: <20240408171818.1856529-1-tromey@adacore.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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: On 4/8/24 1:18 PM, Tom Tromey wrote: > A co-worker noticed a strange situation where "target remote" would > fail due to a trailing newline in the address part of the command. > Eventually he tracked this down to the fact that he was pasting the > command into the terminal, and due to bracketed paste mode, the > newline was being preserved by readline. > > It seems to me that we basically never want a trailing newline on a > gdb command, so this patch removes it when handling the readline > result. > > Co-Authored-By: Kévin Le Gouguec This caused a regression when quitting gdb with ctrl-D: $ ./gdb -nx -q --data-directory=data-directory (gdb) quit <--- hit ctrl-D /home/smarchi/src/binutils-gdb/gdb/event-top.c:257:23: runtime error: null pointer passed as argument 1, which is declared to never be null Here, I have UBSan (I think?) that prints me a nice message, but otherwise it segfaults. I think this is caught by gdb.base/eof-exit.exp, I now see this test failing on my CI. Simon