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.129.124]) by sourceware.org (Postfix) with ESMTPS id 786983858CDB for ; Tue, 7 Nov 2023 18:03:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 786983858CDB 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 786983858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699380227; cv=none; b=h8z3kYdR0ElzxYEuT9HacINbWnXqWUcXH06eL4OsvTqe98efKg7otHBGzJZamIaWdduQn9umNA0Cr0DnLv0x42BxXfqJr6raUrkvY01qanZ/4+kj/T441faz6WlxeqwZygjLjyeRUP8fJf4mQH0CaiR1J7OdACQd6OHD3ukzBKU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699380227; c=relaxed/simple; bh=TTnXyWGLn2mNfnbfnqV0qcEzaN5IbzoKDSpHjgc+G0M=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=qwURSZsAJPrmWQHsJ8adjdFJHNmPuUVjNtJtl2F1yDyA71UVKwmmJ0A2/jucuoN749m5eLFhxdaOllCy+UzKY9RWy6/hNi+t7eNcSz4ls50frozvt2LNqd+OAOykbV0U50+6G3+J6sUcLz7+WaRM6emsM9AZYOg7hE5YIOlNAKM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699380215; 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: content-transfer-encoding:content-transfer-encoding; bh=DEy/SMXRRwmhaIuXDIjWDEbGJnbP4gmDn4Ie3ip070Q=; b=JWdTElLv3eckqHPLKs9xBwvSNgImX9NGVYJP+7OAQNZ89bJgBDjrGCUE6kjSxK6BGm+hxF cR6V+8wTkwyyhWpYEDxU0ZUhuP2yFg0fYgfuftzrcBwwqGRq0t/d4XjlvhJTXNXoRdJYY/ Q57aMJMlBNM2NkxuKnFtsAmzsTUvK4U= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-331-x4XAzZIOMt2WEyBhLnofTA-1; Tue, 07 Nov 2023 13:03:33 -0500 X-MC-Unique: x4XAzZIOMt2WEyBhLnofTA-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-32da39f7f2bso3270034f8f.0 for ; Tue, 07 Nov 2023 10:03:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699380211; x=1699985011; 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=DEy/SMXRRwmhaIuXDIjWDEbGJnbP4gmDn4Ie3ip070Q=; b=LkO+wKjGIjsXcdMbxkIA9kxPMmRUrqZ9NOQlcmI0ATqeYJjsAAbf0E4tXSkiyQVfuI 9p9Pqqj4r21fk71jYcPHAHpVjs9Ta8u8bwoAEmjy3Id4g9sVVtLonmY5Muix90GQnAD6 x2VBl8uZ7ybDDk7gVzFvMEWcw3SVkYYndvc8IJjY6ANL+hBdWesskZLtNLWzJHdNdghl oJAap5wCWggoKtwa9c4IJmMGnmkwqzjt3nQsicurRmgMQookChdtk7hteHDIY/bjg6hJ 9HheZb6sXOc3DqUKLYJLq81k2BrV/GUWkwBR+ZLbeD6u+3ONAkZCJFaLWF8T8zL1KsYG YsIg== X-Gm-Message-State: AOJu0YyE8TkHUjzbuWBUlYwEvZ96G5gSVvv3OcjDGFLEcNLcnLe1Df2+ +U37rWhEOfW93Gj640iJhyeh/YfwzXZJxWykWbZCkHl6YLqC3EuSotCUhTZHh5pG0Ntplt79L1F 9cUstVYBfLMMKY/hlHv4GhDs0+v2hw/251j9f6bIGIZptY6ZkCPuBKu3v9DARUsDb4lOc7DLY4k P0YEoiwQ== X-Received: by 2002:a05:6000:2a9:b0:32f:7628:df3b with SMTP id l9-20020a05600002a900b0032f7628df3bmr24900630wry.6.1699380211119; Tue, 07 Nov 2023 10:03:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYP4Ve6rPs46Gyg/YxQT08eB8BiwjGd4hBmix68mzmK/VS3esUZyvBpurU50qqY0DmE2OntQ== X-Received: by 2002:a05:6000:2a9:b0:32f:7628:df3b with SMTP id l9-20020a05600002a900b0032f7628df3bmr24900597wry.6.1699380210593; Tue, 07 Nov 2023 10:03:30 -0800 (PST) Received: from localhost (105.226.159.143.dyn.plus.net. [143.159.226.105]) by smtp.gmail.com with ESMTPSA id e14-20020a5d530e000000b0032daf848f68sm3000675wrv.59.2023.11.07.10.03.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Nov 2023 10:03:30 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 0/3] Improve debug output support in gdbserver Date: Tue, 7 Nov 2023 18:03:20 +0000 Message-Id: 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.6 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,T_SCC_BODY_TEXT_LINE 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: For another patch I'm working on I wanted to add some additional debug output to gdbserver. Right now there appears to be two broad approaches I could take, these are: 1. Just use threads_debug_printf. The comments in debug.h even claim that this is really the "general" gdbserver debug output and that the "threads" here is just historic, but that feels like a bit of a cop out, we do have separate remote and event-loop debug control. I think what really happened is folk just started reusing the threads_debug_printf rather than adding a new debug category, and over time we just resigned ourselves to threads actually being general output... I think we can do better than that, so 2. We can add a whole new debug category, with a new *_debug_printf function. That I think would be better, but to control this new debug flag we then need to add a new command line flag (we already have --debug, --remote-debug, and --event-loop-debug), and then we need to add new monitor commands to control this new debug setting... this begins to feel not very scalable. So, in this series I try to reimagine debug control in gdbserver, but (hopefully) retain backwards compatibility. The gdbserver command line flag now takes an optional list of components, so we can do: gdbserver --debug=remote,threads to enable 'remote' and 'threads' debug. The default if no components are listed is 'threads', which retains the backwards compatibility. I've also retained the two additional flags '--remote-debug' and '--event-loop-debug'. QUESTION: How would folk feel if I was super aggressive and removed these older flags? In theory these flags are only used for debugging gdbserver itself, but who knows, right? And on the monitor command side, we now support: (gdb) monitor set debug COMPONENT 1 (gdb) monitor set debug COMPONENT 0 to enable and disable debug for COMPONENT. Where COMPONENT is again, 'threads', 'remote', and 'event-loop'. Again, I've retained: (gdb) set debug 1 (gdb) set debug 0 which is equivalent to 'set debug threads 1' or 'set debug threads 0'. And I've also retained the legacy: (gdb) set remote-debug 1 (gdb) set remote-debug 0 (gdb) set event-loop-debug 1 (gdb) set event-loop-debug 0 QUESTION: As with the command line, how would people feel if I ripped out all of the legacy support and required folks to move to the newer command set? --- Andrew Burgess (3): gdbserver: cleanup monitor_show_help gdbserver: allow the --debug command line option to take a value gdbserver: allow for general 'monitor set debug COMPONENT VALUE' use gdb/NEWS | 7 + gdb/doc/gdb.texinfo | 78 ++++++++-- gdb/testsuite/gdb.server/server-mon.exp | 6 + gdbserver/server.cc | 183 ++++++++++++++++++++++-- 4 files changed, 252 insertions(+), 22 deletions(-) base-commit: 2029e13917d53d2289d3ebb390c4f40bd2112d21 -- 2.25.4