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 5EC8E385C41F for ; Wed, 23 Aug 2023 08:19:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5EC8E385C41F Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692778795; 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: in-reply-to:in-reply-to:references:references; bh=DT0nmZsdQKo2XTQIBDj6pVbREATwvuubOOtHZ2pR8aM=; b=Q+KSYR8bR+VohvOWGECbanEYI44KTP2u8IyoVUzUuOYkBaq7vLJz2NTKH8XHcCIRFeM26t dWpMZzaR7AZ6F0a5t9TfS83JojDDfGadUNfj7/j3/zN4NpkgzL3+LS0qTS4dw/TNI2Tej+ egQ0Tj/El4eIRePm9u6C6lDDN9c8mJo= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-650-sPJjKrk7PL-uXev1E-r5Zg-1; Wed, 23 Aug 2023 04:19:53 -0400 X-MC-Unique: sPJjKrk7PL-uXev1E-r5Zg-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-94a34e35f57so361127066b.3 for ; Wed, 23 Aug 2023 01:19:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692778792; x=1693383592; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DT0nmZsdQKo2XTQIBDj6pVbREATwvuubOOtHZ2pR8aM=; b=JL7J/sjrjRWo1NBGOHvQ1y89fb/k1aOyvP66qLMz3aENGcrj9YcghzVD9A5kRxnrov k/qGJKz7vQH4S6mdK2Xvi2VGIZHEs2XG3ZnugwYvKNoJWO7mZTuHvA46eFYFmaozj1R8 w+B1exWRSu7l4KYrYIs1vuQuguMz0mKf7W6xKnvwwYMfS2ohjGvt33gRQaTvy6SSY0By O6Teaq7ZeGN0zslMLzFZ1s2KQPOUBQ6+4x82ggg8K9yixEyaUkUWMX7QGsQ3Xpo3ew6Z H+m+rVPBCQzHqMdUQRjnDVlFtX932UwDvSRKjSQqeIf6WtXUPJF8/5FzmbqQfNrtEudk 6rFA== X-Gm-Message-State: AOJu0YwpCNvPVyuPuzv9qdw2TrsyRtK4MH9Ptw9IjvTNvzQgbIem6KTj fP0VkK4AeXRRrz8SmdjvsaJ32JiH2fG5oEbAn4hWjrqA7o3vnuSevNB9FkE5AhKPwcCkLJa3hJr gwLJzLxmeXUK8DHv8HMbhaRnm6pxj6tH4L7Z2JbcEAiKfoLKMQFY2kPiXBro5H2rTKUJJVH1xp1 jfPFQhxA== X-Received: by 2002:a17:906:5190:b0:9a1:c4ba:c04c with SMTP id y16-20020a170906519000b009a1c4bac04cmr2092228ejk.31.1692778792471; Wed, 23 Aug 2023 01:19:52 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGszNfpFGt5dYyEUlrZn3Z6y5dQ2an0n6VAAsfjKXY2mURYGmwVvCJEV5djrXfvnoKwypffww== X-Received: by 2002:a17:906:5190:b0:9a1:c4ba:c04c with SMTP id y16-20020a170906519000b009a1c4bac04cmr2092211ejk.31.1692778792089; Wed, 23 Aug 2023 01:19:52 -0700 (PDT) Received: from localhost ([31.111.84.232]) by smtp.gmail.com with ESMTPSA id hb13-20020a170906b88d00b0099de082442esm9486537ejb.70.2023.08.23.01.19.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Aug 2023 01:19:51 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PUSHED] gdb/testsuite: improve MI support for inferior specific breakpoints Date: Wed, 23 Aug 2023 09:19:48 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: 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=-11.9 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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: In this commit: commit b080fe54fb3414b488b8ef323c6c50def061f918 Date: Tue Nov 8 12:32:51 2022 +0000 gdb: add inferior-specific breakpoints limited support was added in lib/mi-support.exp to help with testing of inferior specific breakpoints. Though the changes that were added were not wrong, while working on a later patch, I realised that I had added the support in the wrong place -- I only added support to mi_make_breakpoint_multi, when really I should have added the support to mi_make_breakpoint_1, which is used by all of the MI procs that create breakpoints. This commit moves the support to mi_make_breakpoint_1, and updates all the procs that use mi_make_breakpoint_1 to accept, and then pass through, and (optional) inferior argument. This will make it much easier to write MI tests for inferior specific breakpoints. There's no change in what is tested after this commit. --- gdb/testsuite/lib/mi-support.exp | 34 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/gdb/testsuite/lib/mi-support.exp b/gdb/testsuite/lib/mi-support.exp index 3cd94b03c15..c9af88b9b1b 100644 --- a/gdb/testsuite/lib/mi-support.exp +++ b/gdb/testsuite/lib/mi-support.exp @@ -2578,8 +2578,8 @@ proc mi_make_breakpoint_loc {args} { # Bits shared between mi_make_breakpoint and mi_make_breakpoint_multi. -proc mi_make_breakpoint_1 {attr_list thread cond evaluated-by times \ - ignore script original-location} { +proc mi_make_breakpoint_1 {attr_list thread inferior cond evaluated-by \ + times ignore script original-location} { set result "bkpt=\\\{[mi_build_kv_pairs $attr_list]" # There are always exceptions. @@ -2590,6 +2590,12 @@ proc mi_make_breakpoint_1 {attr_list thread cond evaluated-by times \ append result [mi_build_kv_pairs [list "thread" $thread]] } + # If INFERIOR is not present, do not output it. + if {[string length $inferior] > 0} { + append result "," + append result [mi_build_kv_pairs [list "inferior" $inferior]] + } + # If COND is not present, do not output it. if {[string length $cond] > 0} { append result "," @@ -2667,15 +2673,9 @@ proc mi_make_breakpoint_multi {args} { lappend attr_list "addr" "" - # Only include the inferior field if it was set. This field is - # optional in the MI output. - if {$inferior ne ""} { - lappend attr_list "inferior" $inferior - } - set result [mi_make_breakpoint_1 \ - $attr_list $thread $cond ${evaluated-by} $times \ - $ignore $script ${original-location}] + $attr_list $thread $inferior $cond ${evaluated-by} \ + $times $ignore $script ${original-location}] append result "," append result [mi_build_kv_pairs [list "locations" $locations]] @@ -2703,8 +2703,8 @@ proc mi_make_breakpoint_multi {args} { proc mi_make_breakpoint_pending {args} { parse_args {{number .*} {type .*} {disp .*} {enabled .*} - {pending .*} {original-location .*} {thread ""} {cond ""} - {script ""} {times .*}} + {pending .*} {original-location .*} {thread ""} {inferior ""} + {cond ""} {script ""} {times .*}} set attr_list {} foreach attr [list number type disp enabled] { @@ -2721,8 +2721,8 @@ proc mi_make_breakpoint_pending {args} { set evaluated-by "" set result [mi_make_breakpoint_1 \ - $attr_list $thread $cond ${evaluated-by} $times \ - $ignore $script ${original-location}] + $attr_list $thread $inferior $cond ${evaluated-by} \ + $times $ignore $script ${original-location}] append result "\\\}" return $result @@ -2750,7 +2750,7 @@ proc mi_make_breakpoint {args} { {func .*} {file .*} {fullname .*} {line .*} {thread-groups \\\[.*\\\]} {times .*} {ignore 0} {script ""} {original-location .*} {cond ""} {evaluated-by ""} - {thread ""}} + {thread ""} {inferior ""}} set attr_list {} foreach attr [list number type disp enabled addr func file \ @@ -2759,8 +2759,8 @@ proc mi_make_breakpoint {args} { } set result [mi_make_breakpoint_1 \ - $attr_list $thread $cond ${evaluated-by} $times \ - $ignore $script ${original-location}] + $attr_list $thread $inferior $cond ${evaluated-by} \ + $times $ignore $script ${original-location}] append result "\\\}" return $result base-commit: f29ab2e0e350a4b382a1e4eb1b41c28564d83e94 -- 2.25.4