From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by sourceware.org (Postfix) with ESMTPS id 2D2C63844748 for ; Mon, 15 Apr 2024 18:28:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2D2C63844748 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2D2C63844748 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::d31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713205716; cv=none; b=bxsIWntCBRtV3yJ9BXYCZwXochc/y+J0XRyL1zQ+KEfyrIDndoHU8HqRygKcw0ywkRXesHnv/c0Elfa/r/76rdES8t6RdoIH9khcP9U/es6Rj0tqQT+JnivZfq+4+CgZNmPPL5nQGGUuN1v7S5A+JGupXwLvdiaUcj08Bww8uMY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713205716; c=relaxed/simple; bh=2JeM2Lji4Oq9nq+GmfIn2K8wYvuHGbvR/UcQBhgFpvQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=EJWq7HZBFPgdC9GXjxIvu4FDon8pOjoCnzKyRraQ6qVifLGknIHYfZmQGbXq31DoV1QWz2jMfxIpQk6p5jb2WC/gX3J1bAAZcd7IA8pckfvurvEcrCj2Hel/RMFSUXylRR2ysw7jTqBEKB+q26iTYNRkqdbEY7MCEweZS/ISOXU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-io1-xd31.google.com with SMTP id ca18e2360f4ac-7d5d7d570dcso162546539f.1 for ; Mon, 15 Apr 2024 11:28:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1713205713; x=1713810513; darn=sourceware.org; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=rEQy9tIO2oAdVtPISSbf6mCpzSLq2Xy9E7ZDXpepjRE=; b=hWuZQ5AqDjYNVXmEVqYYABm3CdU8nNZl3FWrp+QnskKoMRe9NAiHJD/o1STWDFKS65 vugXLIZSg53RYYIbHYlsw4mhPL1qMAvTD2PBjInwUzFYWNtCxrsWQtzS9JI9HE4W+XXm HzvpbKnWur5EB6m3+TQRbda0TuUrroszit6meG8/Hlj+qrEhHq0jNtPv7qV8AioECjZt 6bYejrlSO71ySJsH3LevnPdJ8nqs5WFA75CFbssjZm4fS5QPwpF44Zlv6ToJPSzBI54z m7DCXa1e7Oq5AHS2BfvcE0O3HbpecFcLjX7rzQkCkT9/sZriSE20gPvlGotXmavhheHC /BNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713205713; x=1713810513; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=rEQy9tIO2oAdVtPISSbf6mCpzSLq2Xy9E7ZDXpepjRE=; b=PL3+6PLS/jDt/UH7e+MKuwxY17dz40/t0EQkYN+LvGzFySZ/Ggy4lYyM7pxIoLpa0y IeoVI7pLiq5ii+kyHMk9BIOx7+WvEh/32iiyusDSXJ+Qi6zMngtlIb/SmhjF6Pj0M9vZ YnbU0e/hDJels9Yomrif5Ne2JzYj7n6EoqSNQ2oJterz4aAlQ8irKxTr6zGqUmGKsmo+ v8tdG7E3qLBCTRbkURzVLkjsQmSXdk/erLcg5rbdKythfqPTju2UMayeB2t7y9B0ob3j fknik6tR27hsmTrveHIv8lIKvvq+bCktKDgdIkYr/STo/WNP6AvowfY8X8PhD2JSvL87 BY9g== X-Forwarded-Encrypted: i=1; AJvYcCUN5XP+u2TLOMO5DKuUCz+pJsB4QRA2+F+doub9O2cPDHAvD7+fZZqOY1nOuWJRRjH9H55hRagmS2E58sYt+YsQL2wOWRUiR2hcJg== X-Gm-Message-State: AOJu0Yz1Tuj/KULoxGeza6xjlF5sqBrVpASaT7GKEkwD2S4FA3kb0I6O JigqLGDeWA4zkJO7ZLMOwOFxUm7E7nV8tLYP3Ksp2R92aSBJEvi0FZlIZhds9Q== X-Google-Smtp-Source: AGHT+IHXEOylTYyECYqNNPtkNQGAGu2WyIT2z/4Sritkg23bqvig1JwAXVcB6K9lIay3oJZunCkAlg== X-Received: by 2002:a05:6602:3942:b0:7d6:aa:8a54 with SMTP id bt2-20020a056602394200b007d600aa8a54mr17124304iob.11.1713205712051; Mon, 15 Apr 2024 11:28:32 -0700 (PDT) Received: from murgatroyd (97-122-82-115.hlrn.qwest.net. [97.122.82.115]) by smtp.gmail.com with ESMTPSA id ci10-20020a0566383d8a00b004830919e5b9sm818790jab.123.2024.04.15.11.28.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 11:28:31 -0700 (PDT) From: Tom Tromey To: Simon Marchi Cc: Tom Tromey , gdb-patches@sourceware.org, =?utf-8?Q?K=C3=A9vin?= Le Gouguec Subject: Re: [PP?] [PATCH] Strip trailing newlines from input string References: <20240408171818.1856529-1-tromey@adacore.com> <67ad3a03-2904-4bdd-b297-91c0ecd6fa4b@simark.ca> X-Attribution: Tom Date: Mon, 15 Apr 2024 12:28:31 -0600 In-Reply-To: <67ad3a03-2904-4bdd-b297-91c0ecd6fa4b@simark.ca> (Simon Marchi's message of "Mon, 15 Apr 2024 14:21:07 -0400") Message-ID: <87wmoy1nw0.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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: >>>>> "Simon" =3D=3D Simon Marchi writes: Simon> 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. >>=20 >> 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. >>=20 >> Co-Authored-By: K=C3=A9vin Le Gouguec Simon> This caused a regression when quitting gdb with ctrl-D: Simon> $ ./gdb -nx -q --data-directory=3Ddata-directory Simon> (gdb) quit <--- hit ctrl-D Simon> /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 Simon> Here, I have UBSan (I think?) that prints me a nice message, but Simon> otherwise it segfaults. Simon> I think this is caught by gdb.base/eof-exit.exp, I now see this test Simon> failing on my CI. Huh, I see it too. I'll fix this, sorry about the breakage. Tom