From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id ACEB33858C30 for ; Mon, 20 Feb 2023 14:47:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org ACEB33858C30 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pU7S1-0003gc-88; Mon, 20 Feb 2023 09:47:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=O+XEN8W85lu3S0nHOT8oUndxof7wbRa0fQXErPNwufQ=; b=R/GzWE2+x3mq 46MUR2e42z8FvYI5YC7napwP5M+/xUmCmiAAvALj5wswdZzv3cWvutSiaKCNvdwzPBwAx8qPB8s9h 1o/x8PpwRu/TUp7nDJVE1hbUL3vstV0T+L3encmbcqXYwUQb70kdyIjV6BsiLuWsaypwGyD0ZFQg4 OMPBMHEKC8fbcxvhBSrLHYmlv2Jd8XM/WsBCpl0iiE5JDBtEO+lJsYtcZ5DUc/voEgZumRDSpWnCc vTMinNBWBJnFNN8+jrhulp2BR4jocPI+oYr/lRvB599xYdzSGxzz9/gHS7Qudo2H2CRQP/WNWxB8I cls5EhwNlsAriyxclHJAuw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pU7S0-0003mo-93; Mon, 20 Feb 2023 09:47:32 -0500 Date: Mon, 20 Feb 2023 16:47:41 +0200 Message-Id: <838rgsv1f6.fsf@gnu.org> From: Eli Zaretskii To: Andrew Burgess Cc: gdb-patches@sourceware.org In-Reply-To: (message from Andrew Burgess via Gdb-patches on Mon, 20 Feb 2023 14:13:47 +0000) Subject: Re: [PATCH 2/8] gdb: don't duplicate 'thread' field in MI breakpoint output References: X-Spam-Status: No, score=1.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_BARRACUDACENTRAL,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: > Cc: Andrew Burgess > Date: Mon, 20 Feb 2023 14:13:47 +0000 > From: Andrew Burgess via Gdb-patches > > When creating a thread-specific breakpoint with a single location, the > 'thread' field would be repeated in the MI output. This can be seen > in two existing tests gdb.mi/mi-nsmoribund.exp and > gdb.mi/mi-pending.exp, e.g.: > > (gdb) > -break-insert -p 1 bar > ^done,bkpt={number="1",type="breakpoint",disp="keep", > enabled="y", > addr="0x000000000040110a",func="bar", > file="/tmp/mi-thread-specific-bp.c", > fullname="/tmp/mi-thread-specific-bp.c", > line="32",thread-groups=["i1"], > thread="1",thread="1", <================ DUPLICATION! > times="0",original-location="bar"} > > I know we need to be careful when adjusting MI output, but I'm hopeful > in this case, as the field is duplicated, and the field contents are > always identical, that we might get away with removing one of the > duplicates. > > The change in GDB is a fairly trivial condition change. > > We did have a couple of tests that contained the duplicate fields in > their expected output, but given there was no comment pointing out > this oddity either in the GDB code, or in the test, I suspect this was > more a case of copying whatever output GDB produced and using that as > the expected results. I've updated these tests to remove the > duplication. > > I've update lib/mi-support.exp to provide support for building > breakpoint patterns that contain the thread field, and I've made use > of this in a new test I've added that is just about creating > thread-specific breakpoints and checking the results. The two tests I > mentioned above as being updated could also use the new > lib/mi-support.exp functionality, but I'm going to do that in a later > patch, this was it is clear what changes I'm actually proposing to > make to the expected output. > > As I said, I hope that frontends will be able to handle this change, > but I still think its worth adding a NEWS entry, that way, if someone > runs into problems, there's a chance they can figure out what's going > on. > > This should not impact CLI output at all. > --- > gdb/NEWS | 8 +++ > gdb/breakpoint.c | 2 +- > gdb/testsuite/gdb.mi/mi-nsmoribund.exp | 2 +- > gdb/testsuite/gdb.mi/mi-pending.exp | 2 +- > gdb/testsuite/gdb.mi/mi-thread-specific-bp.c | 44 +++++++++++++++++ > .../gdb.mi/mi-thread-specific-bp.exp | 49 +++++++++++++++++++ > gdb/testsuite/lib/mi-support.exp | 32 ++++++++---- > 7 files changed, 127 insertions(+), 12 deletions(-) > create mode 100644 gdb/testsuite/gdb.mi/mi-thread-specific-bp.c > create mode 100644 gdb/testsuite/gdb.mi/mi-thread-specific-bp.exp Thanks, the NEWS part is OK. Reviewed-By: Eli Zaretskii