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 277913858C50 for ; Wed, 8 Feb 2023 15:23:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 277913858C50 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=1675869819; 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=EtlS7X/0eePjlHQJfe1etJkzGJo0sdsy3mLQNsp8/N4=; b=S0fE6ladwVZxdaTK+ysMs/w75qgbXqOR/RxmmkODqEEBcrFF1WfNYMkIWFrautPEp6b+X0 HmYa7i4B916YCAgLF9npIUcvEm3OasF7e1lyTXKfEnfKnMFMD6aCOTd0xwKcVcGjM25YZD 5Hza+cL7Q2/DBDHtCxO+I+yaAmgk5/U= Received: from mail-qv1-f72.google.com (mail-qv1-f72.google.com [209.85.219.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-354-P20oLH_vOhSYtR3UymFvrQ-1; Wed, 08 Feb 2023 10:23:38 -0500 X-MC-Unique: P20oLH_vOhSYtR3UymFvrQ-1 Received: by mail-qv1-f72.google.com with SMTP id k15-20020a0cd68f000000b00535261af1b1so9988240qvi.13 for ; Wed, 08 Feb 2023 07:23:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=EtlS7X/0eePjlHQJfe1etJkzGJo0sdsy3mLQNsp8/N4=; b=X1gDk5mDB9Ev0xP3T9WdJZgSLY6Vk+K/4Jf2PWCzGVllAmxqvdKkmQKZ9LuZRalDph yePPPGJXPyL0IsRjrB0QZYLxvybyJiz6any/j6vPsRL5w3/KZe4lRwshsL+85db6sqSn V+vHozSxjzwdqpGqIq/7Lzb5a0kU8ZdBI/WWk8oZ6YBdSvNuluRGozglXT6N3Pko8myB mD4SyEH4a8zAjDfBGjfJXdeNK4pFPLr5sixTTCEus4HNNAzKZG/DmloG3rc6Tk0XBecH 5sP8g/2c7zV8hogUTKFa9tNrKpmzDZ2S3WAux2HiIN+ETi04NwEgJomEfAUVip6mwTCf uzZg== X-Gm-Message-State: AO0yUKVD9nQ1GxoTbPRXrfSOj6N9E8l3USt5MHc23BnotRhlO/qb8wrY 5bX3mCaS3dQ61MMeSxb9kqW4qBF9rtGY8HjHINRiww36S4tdnPcg/dcDU6ae0PQUMRddYNkJ9Ea o/PtmTDGjpIU7bZryqrbFieXWimHxSmRC1wzciIE1tp75cyWdDvvrrXfc5MXHFCVZdoVYvSXF7t eGfOQ= X-Received: by 2002:a05:622a:110c:b0:3ba:1acd:4da with SMTP id e12-20020a05622a110c00b003ba1acd04damr12537799qty.60.1675869817924; Wed, 08 Feb 2023 07:23:37 -0800 (PST) X-Google-Smtp-Source: AK7set+yHn05tAYX5NcE/WHZJjVurRQt/qksXL3xWO1DNkfvzlKiOUFcdEEmFH7ToU5Xch+JQv2zIA== X-Received: by 2002:a05:622a:110c:b0:3ba:1acd:4da with SMTP id e12-20020a05622a110c00b003ba1acd04damr12537766qty.60.1675869817597; Wed, 08 Feb 2023 07:23:37 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id g7-20020a05620a40c700b007208a81e11esm11337436qko.41.2023.02.08.07.23.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Feb 2023 07:23:37 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 2/3] gdb: show task number in describe_other_breakpoints Date: Wed, 8 Feb 2023 15:23:29 +0000 Message-Id: <8716dc72011765a13c3eee0b60a262fbcbd48d41.1675869497.git.aburgess@redhat.com> 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.7 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_H2,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: I noticed that describe_other_breakpoints doesn't show the task number, but does show the thread-id. I can't see any reason why we'd want to not show the task number in this situation, so this commit adds this missing information, and extends gdb.ada/tasks.exp to check this case. --- gdb/breakpoint.c | 2 ++ gdb/testsuite/gdb.ada/tasks.exp | 17 +++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 701555a060e..6b576859592 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -7049,6 +7049,8 @@ describe_other_breakpoints (struct gdbarch *gdbarch, struct thread_info *thr = find_thread_global_id (b->thread); gdb_printf (" (thread %s)", print_thread_id (thr)); } + else if (b->task != 0) + gdb_printf (" (task %d)", b->task); gdb_printf ("%s%s ", ((b->enable_state == bp_disabled || b->enable_state == bp_call_disabled) diff --git a/gdb/testsuite/gdb.ada/tasks.exp b/gdb/testsuite/gdb.ada/tasks.exp index 88ef123865b..83692054e4f 100644 --- a/gdb/testsuite/gdb.ada/tasks.exp +++ b/gdb/testsuite/gdb.ada/tasks.exp @@ -50,16 +50,21 @@ gdb_test "watch j task 1 task 3" "You can specify only one task\\." # breakpoint in the list that matched the triggered-breakpoint's # address, no matter which task it was specific to. gdb_test "break break_me task 1" "Breakpoint .* at .*" +set bp_number [get_integer_valueof "\$bpnum" "INVALID" \ + "get number of breakpoint for task 1"] gdb_test "info breakpoints" "foo.adb:${decimal}\r\n\\s+stop only in task 1" \ "check info breakpoints for task 1 breakpoint" # Now, insert a breakpoint that should stop only if task 3 stops, and -# extract its number. -gdb_breakpoint "break_me task 3" message -set bp_number [get_integer_valueof "\$bpnum" -1] -if {$bp_number < 0} { - return -} +# extract its number. Use gdb_test here so that we can validate that +# the 'Breakpoint ... also set at' line correctly includes the task +# number of the prevoius breakpoint. +gdb_test "break break_me task 3" \ + [multi_line \ + "Note: breakpoint $bp_number \\(task 1\\) also set at pc $hex\\." \ + "Breakpoint $decimal at $hex: \[^\r\n\]+"] +set bp_number [get_integer_valueof "\$bpnum" "INVALID" \ + "get number of breakpoint for task 3"] gdb_test "info breakpoints" "foo.adb:${decimal}\r\n\\s+stop only in task 3" \ "check info breakpoints for task 3 breakpoint" -- 2.25.4