Message ID | cover.1692200989.git.aburgess@redhat.com |
---|---|
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 25D0A3858002 for <patchwork@sourceware.org>; Wed, 16 Aug 2023 15:55:39 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 25D0A3858002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1692201339; bh=4oXylloki05ODUWXjvEU4wd1Ln1+aNOYzgd3ysLZtfE=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=KOKBHuWI31h19ug4iGpYR8ZhHpExmgSl7OD7XL0GpyKojGq5ZehJr1PO6+Nb5qdHZ r43T8ovs40CZu94ZiTH6/jqLfSKvoFggiSlIdf+WxsX0z1DEMq8tM0P3VH2XBsEyXv 0urD8xznAjWX7wXUCorg4qJRGSz2ZRWaKc+epDc4= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 495533857715 for <gdb-patches@sourceware.org>; Wed, 16 Aug 2023 15:55:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 495533857715 Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-202-GcLTxGN8PEyPgqNfdrC54Q-1; Wed, 16 Aug 2023 11:55:10 -0400 X-MC-Unique: GcLTxGN8PEyPgqNfdrC54Q-1 Received: by mail-lj1-f198.google.com with SMTP id 38308e7fff4ca-2b9bee2d344so68994511fa.1 for <gdb-patches@sourceware.org>; Wed, 16 Aug 2023 08:55:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692201309; x=1692806109; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4oXylloki05ODUWXjvEU4wd1Ln1+aNOYzgd3ysLZtfE=; b=lSYuH/MPVZ18+gDz7mEXUJZqkImWGVrPakjVdRWSoylIL5wNeZ9xFg0uj5pp/PuVng orseI8IYGdKRCJjnq+vBMNhW0ZOoOM8kgOc6FCKySOxAYNCvxgJNqupYWxZ0NrC0sPjB tJ1Lfhf5zBxkjNOPsKRk6iLDBNbAKBOceyhG2KhFB8IM/SvOKaF/tPLtwJY72nSH6hX5 db3k/aBotO3R3t6nfFWXcVmyP7Y9LeXwSJtYrWB4JYp7/drG01iuatQ9ImsHNdN5Ryxs tQbA6d+h1AH98ex0iu4TtopsdoPDAnd+jsxKLGtMLJSQNc665PEUE4O5rZMf58mgCc4M qQng== X-Gm-Message-State: AOJu0Yy9/hzBj3ufbHqRtEL6d/3BmkygbzRuOdoxTK15Q/mgnX1z3WGp y8CfLxogk5gjUm/e2HulKpcTZthS3pN9tsOTj1MU7SbBX1z3WRIMb8Z0TInPxEOkfIjaeuXkueN 7u6s0WSZuuxmQkMRGPKsHwdKnBpA1AC97LG+iw/8vfJj9dZgblhMYxWvxlf7GmvbKIbP0aAWOdq YZVUijUw== X-Received: by 2002:a2e:a304:0:b0:2b9:ecc5:d1de with SMTP id l4-20020a2ea304000000b002b9ecc5d1demr1557059lje.37.1692201308886; Wed, 16 Aug 2023 08:55:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgwQeaTqzxW3V8vqJN3jzdcHm1ugQdfN6/7v9zm72eJjKMykLibzh+AdVGav+/NXH4AW5gLA== X-Received: by 2002:a2e:a304:0:b0:2b9:ecc5:d1de with SMTP id l4-20020a2ea304000000b002b9ecc5d1demr1557039lje.37.1692201308483; Wed, 16 Aug 2023 08:55:08 -0700 (PDT) Received: from localhost ([31.111.84.232]) by smtp.gmail.com with ESMTPSA id cb13-20020a170906a44d00b0099bc08862b6sm8818608ejb.171.2023.08.16.08.55.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Aug 2023 08:55:08 -0700 (PDT) To: gdb-patches@sourceware.org Cc: Andrew Burgess <aburgess@redhat.com> Subject: [PATCH 00/10] Improve GDB/gdbserver experience when using a local gdbserver Date: Wed, 16 Aug 2023 16:54:56 +0100 Message-Id: <cover.1692200989.git.aburgess@redhat.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-5.8 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Andrew Burgess via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Andrew Burgess <aburgess@redhat.com> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Improve GDB/gdbserver experience when using a local gdbserver
|
|
Message
Andrew Burgess
Aug. 16, 2023, 3:54 p.m. UTC
The goal of this series is to improve the user experience when using a local (running on the same machine as GDB) gdbserver. Outside of testing, there are still plenty of occasions when a user can end up running gdbserver on the same machine as GDB, tools like valgrind communicate via the remote protocol, as do many simulators (other than those built into GDB). This series includes the following improvements: 1. Better handling of gdbserver's default executable and arguments. This applies to remote gdbservers and local gdbservers, 2. Allow sysroot 'target:' prefix to be ignored when gdbserver is running locally to GDB, and 3. Allow the user to skip setting 'remote exec-file' if gdbserver is running locally to GDB. --- Andrew Burgess (10): gdb: have remote_target::extended_remote_run take the exec filename gdb: improve how 'remote exec-file' is stored and accessed gdb: improve show text and help text for 'remote exec-file' gdb/gdbserver: add new qDefaultExecAndArgs packet gdb: detect when gdbserver has no default executable set gdb: make use of is_target_filename gdb: add qMachineId packet gdb: remote filesystem can be local to GDB in some cases gdb: use exec_file with remote targets when possible gdb: remote the get_remote_exec_file function gdb/Makefile.in | 3 + gdb/NEWS | 45 ++ gdb/build-id.c | 2 +- gdb/configure.nat | 2 +- gdb/doc/gdb.texinfo | 160 ++++ gdb/gdb_bfd.h | 8 + gdb/linux-nat.c | 35 + gdb/nat/linux-machine-id.c | 60 ++ gdb/nat/linux-machine-id.h | 44 ++ gdb/remote-machine-id.c | 69 ++ gdb/remote-machine-id.h | 108 +++ gdb/remote.c | 683 +++++++++++++++--- gdb/testsuite/gdb.base/remote-exec-file.exp | 7 +- gdb/testsuite/gdb.multi/gdb-settings.exp | 13 + gdb/testsuite/gdb.server/ext-run.exp | 131 +++- .../gdb.server/fetch-exec-and-args.c | 34 + .../gdb.server/fetch-exec-and-args.exp | 253 +++++++ gdb/testsuite/gdb.server/server-local-fs.c | 22 + gdb/testsuite/gdb.server/server-local-fs.exp | 138 ++++ gdb/testsuite/gdb.server/sysroot.exp | 90 +-- gdbserver/Makefile.in | 1 + gdbserver/configure.srv | 2 +- gdbserver/linux-low.cc | 19 + gdbserver/linux-low.h | 2 + gdbserver/server.cc | 47 ++ gdbserver/target.cc | 8 + gdbserver/target.h | 9 + 27 files changed, 1835 insertions(+), 160 deletions(-) create mode 100644 gdb/nat/linux-machine-id.c create mode 100644 gdb/nat/linux-machine-id.h create mode 100644 gdb/remote-machine-id.c create mode 100644 gdb/remote-machine-id.h create mode 100644 gdb/testsuite/gdb.server/fetch-exec-and-args.c create mode 100644 gdb/testsuite/gdb.server/fetch-exec-and-args.exp create mode 100644 gdb/testsuite/gdb.server/server-local-fs.c create mode 100644 gdb/testsuite/gdb.server/server-local-fs.exp base-commit: a345d14fa65c2b69f2ba3abac8847b1c6a4dc656
Comments
On Wed, Aug 16, 2023 at 5:55 PM Andrew Burgess via Gdb-patches < gdb-patches@sourceware.org> wrote: > The goal of this series is to improve the user experience when using a > local (running on the same machine as GDB) gdbserver. > > Outside of testing, there are still plenty of occasions when a user > can end up running gdbserver on the same machine as GDB, tools like > valgrind communicate via the remote protocol, as do many simulators > (other than those built into GDB). > > This series includes the following improvements: > > 1. Better handling of gdbserver's default executable and arguments. > This applies to remote gdbservers and local gdbservers, > > 2. Allow sysroot 'target:' prefix to be ignored when gdbserver is > running locally to GDB, and > > 3. Allow the user to skip setting 'remote exec-file' if gdbserver is > running locally to GDB. > > > I think the series is great, I'm really excited to see them. I especially appreciate how this improves using GDB with Valgrind's vgdb --multi.
Hi Andrew, On Wed, 2023-08-16 at 16:54 +0100, Andrew Burgess wrote: > The goal of this series is to improve the user experience when using a > local (running on the same machine as GDB) gdbserver. > > Outside of testing, there are still plenty of occasions when a user > can end up running gdbserver on the same machine as GDB, tools like > valgrind communicate via the remote protocol, as do many simulators > (other than those built into GDB). > > This series includes the following improvements: > > 1. Better handling of gdbserver's default executable and arguments. > This applies to remote gdbservers and local gdbservers, > > 2. Allow sysroot 'target:' prefix to be ignored when gdbserver is > running locally to GDB, and > > 3. Allow the user to skip setting 'remote exec-file' if gdbserver is > running locally to GDB. I read through most of this patch series and created a trivial qDefaultExecAndArgs for vgdb that just returns 'U' and it seems to work just fine, no more setting of remote exec-file needed \o/ https://bugs.kde.org/show_bug.cgi?id=473687 I have to think a bit more about qMachineId. There were also some opinions expressed in this bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30541 Thanks, Mark
Mark Wielaard <mark@klomp.org> writes: > Hi Andrew, > > On Wed, 2023-08-16 at 16:54 +0100, Andrew Burgess wrote: >> The goal of this series is to improve the user experience when using a >> local (running on the same machine as GDB) gdbserver. >> >> Outside of testing, there are still plenty of occasions when a user >> can end up running gdbserver on the same machine as GDB, tools like >> valgrind communicate via the remote protocol, as do many simulators >> (other than those built into GDB). >> >> This series includes the following improvements: >> >> 1. Better handling of gdbserver's default executable and arguments. >> This applies to remote gdbservers and local gdbservers, >> >> 2. Allow sysroot 'target:' prefix to be ignored when gdbserver is >> running locally to GDB, and >> >> 3. Allow the user to skip setting 'remote exec-file' if gdbserver is >> running locally to GDB. > > I read through most of this patch series and created a trivial > qDefaultExecAndArgs for vgdb that just returns 'U' and it seems to work > just fine, no more setting of remote exec-file needed \o/ > https://bugs.kde.org/show_bug.cgi?id=473687 Excellent. > I have to think a bit more about qMachineId. > There were also some opinions expressed in this bug: > https://sourceware.org/bugzilla/show_bug.cgi?id=30541 Thanks for the link. I'd not read that. I think the only thing I took from that was that the boot-id that I'm currently using likely isn't going to work w.r.t. containers -- but Thiago Jung Bauermann already pointed that out. We already have some container detection support (at least, I believe that's what it's doing) in linux_nat_target::filesystem_is_local (), so I'm hoping I can use something based off that to extend what I currently have. It's just testing it that's going to slow me down, but I hope to take another pass at it soon. Thanks, Andrew