From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 28EEA3858D38 for ; Fri, 12 Apr 2024 17:42:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 28EEA3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 28EEA3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712943738; cv=none; b=BNuphH3uEuzhyeFAzT52WvDZDij+/UkQ5Euy9149k6LbUyM/Z5iLeHVuorHjBI5K6IaV6O+H0FW2kXMaHctyvGXrW3fMnxIhYNW3+64xiUGR3xtMbp3OVoU/1anQ7Wwr+lAHDHkW9LVlo3U+52hAaYv64JHAYjstb5iM9OIWgTY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712943738; c=relaxed/simple; bh=axIecVumcMZU5HOvadmTuVwj3xA0OitkVrFqQRlYgWU=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=Tv+K38SH9QfaBDtEr5bRohL2LWe74UGK0m2wbZZJVIkxyB85lgU6YzO8CJoVtWootqYMF+GKmicilU7cYebIEi8jv489v7FXbxEreotg/MHOPsRWAQ6Ax/2TrDkexpE2aewaP6cEzY9HK4SLjLh2KLDNAOz/FF+bCmpm/zsKH4U= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1712943736; 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: in-reply-to:in-reply-to:references:references; bh=rtnJoQLI16RJDlYABv3EG5+SM2oUT8bkb8wG1SueQ70=; b=E/io0KLrX/5TCFLqIpBD/gLQlP05W6wWiDg7+eC+RZjFeBrz9aYyBQJDmrZXhnlnxeYZ7Y 2KbzpGON4MIbRY37O2W8cOGnIcCm2VG3/R2JtJ0BSth3jEHqGF6Uk1GcaKXnw4G4LGYgRK 7nVs18zkvTfv+Ta467t1J0xTUQ0HKR4= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-160-yh9oZrRHMAeI7PEys-CgAA-1; Fri, 12 Apr 2024 13:42:15 -0400 X-MC-Unique: yh9oZrRHMAeI7PEys-CgAA-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-516fbb5e430so924869e87.2 for ; Fri, 12 Apr 2024 10:42:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712943733; x=1713548533; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rtnJoQLI16RJDlYABv3EG5+SM2oUT8bkb8wG1SueQ70=; b=O6+dssUTIZ2njDpmqPquJxtBSuG+z4NgXFU1AILirHVkt7WmiTIx/XOXBn+lP+/aYl hCUrwxfORwo98lZDmVoJ59LxGwjuV8DcqtLw9l2T6MebuKYWlCtG/gAEgcdUOJBX2mQe KfOrpujI74qQHBYhvbxTys/gItn0gobvMcf/IVrNunpMoXejnbMv5BaL4gu2WWQYbnKQ 9xpOXufbK8/jNUtGkGyAE9O29Mg4hN/xeflP9QB6QKY9d7izMdh8jHDX3QjlRtYERQeD pvDh1ktClOW0x5H7Seb2mHh8bVVYJf5o/qpKcS6U/MWT1lIlK7ohvzhENySdnv7Eypgu 0AWQ== X-Gm-Message-State: AOJu0YxXFvwszHeDPCht1Bu1Md5v6nkRSkyhRCLC0GkqU83fPjGjw0oP c4c2xFLzptQSxVG1351J8Q85uACU27gABwpRF4z0bb/tNBPHfPPEyvCRCjf62qWe92++BmxXLZ0 XHljt+RNCg8rQd4UAW0sqMaoI+EiOwd/9W+OVkmfT6BG4kjdjgqHkZyWXJqabodRy9IQ= X-Received: by 2002:a19:f013:0:b0:513:dd23:7a02 with SMTP id p19-20020a19f013000000b00513dd237a02mr2319512lfc.26.1712943733542; Fri, 12 Apr 2024 10:42:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFpEIjGVoHzFOd9WeVD/xlD3FMFrDQmZshpEmszQOhMlGsMF71HYSmecQtNj7l2XexDGGhdrw== X-Received: by 2002:a19:f013:0:b0:513:dd23:7a02 with SMTP id p19-20020a19f013000000b00513dd237a02mr2319508lfc.26.1712943732947; Fri, 12 Apr 2024 10:42:12 -0700 (PDT) Received: from localhost (185.223.159.143.dyn.plus.net. [143.159.223.185]) by smtp.gmail.com with ESMTPSA id q12-20020a05600c46cc00b00417bab31bd2sm6323658wmo.26.2024.04.12.10.42.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Apr 2024 10:42:12 -0700 (PDT) From: Andrew Burgess To: Eli Zaretskii , Lancelot SIX Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 4/6] gdb: add match formatter mechanism for 'complete' command output In-Reply-To: <86ttknaqsx.fsf@gnu.org> References: <6adc14efeac88ecd9501c0c8c53b622099333792.1711712401.git.aburgess@redhat.com> <20240330234918.fk4gdzmdeoojia27@octopus> <86ttknaqsx.fsf@gnu.org> Date: Fri, 12 Apr 2024 18:42:12 +0100 Message-ID: <87pluu4gwb.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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: Eli Zaretskii writes: >> Date: Sat, 30 Mar 2024 23:49:18 +0000 >> From: Lancelot SIX >> Cc: gdb-patches@sourceware.org >> >> > (gdb) complete file '/tmp/xx >> > file '/tmp/xxx/' >> > >> > The completion offered here is really only a partial completion, we've >> > completed up to the end of the next directory name, but, until we have >> > a filename then the completion is not finished and the trailing quote >> > should not be added. >> > >> > This would match the readline behaviour, e.g.: >> > >> > (gdb) file '/tmp/xx >> > (gdb) file '/tmp/xxx/ >> > >> > In this case readline completes the directory name, but doesn't add >> > the trailing quote character. > > Btw, what readline does is not the only useful behavior. An > alternative would be this: > > (gdb) file '/tmp/xx > => (gdb) file '/tmp/xx/' > (gdb) file '/tmp/xx/'a > => (gdb) file '/tmp/xx/abcd' > > That is, allow to type after the closing quote, and remove the closing > quote before trying to complete. This way, the user can use > '/tmp/xx/' if that is what she needs, or continue typing and > completing if not. That does sound better. I think there are still things that would need figuring out. For example, what if the user didn't do the second tab completion, but just kept typing. (gdb) file '/tmp/xx => (gdb) file '/tmp/xx/' (gdb) file '/tmp/xx/'abcd => ?? What would this do? What if there really was a file /tmp/xx/'abcd ? What happens then? But I do think this sounds like an interesting idea. But... ... I don't think I want to start making such sweeping changes to readline, or how GDB uses readline. Or maybe that would require moving off readline completely? My goal with this work is to support '-filename PATH' command options using GDB's option framework. Adding such options really calls for good filename completion. [ NOTE: I'm not adding those options in this series, that would be the next project. ] Ideally I want to work with GDB as it is right now, i.e. how does GDB work right now, and how does GDB parse filenames right now, and have filename completion work with those constraints. Thanks, Andrew