From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) by sourceware.org (Postfix) with ESMTPS id 77BA93858C50 for ; Wed, 8 Feb 2023 17:55:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 77BA93858C50 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f53.google.com with SMTP id l37-20020a05600c1d2500b003dfe46a9801so2122490wms.0 for ; Wed, 08 Feb 2023 09:55:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QsiGBydNIRNIythAW/NVh/tnh1TQZ9onP7EjarTJzNA=; b=l1lw/xeRctCaKYgrkO8yn7dWayCXE6Ws+8gfxAgfTo3ud9p0VBY2QL6Hi54twd8Xpx th9EnuLbqHqlYkd+MvD77XOyqzOohTBUDghUa6FZQYfAGv/IgZPfDLQdkPUnhoWrQRax 30NSGolzCjv7Aw4ZUFBVBEa4q06nL4oLo8ucrt6gJD7qorZ1OebSWLeMGGZRyjrCoKfr nW5QdEfY6xhZQPRR7zZbUAIZChj9TLYUslcN7XBR3H2FGOXyd4zvIEoUFF5CnT8GKCFu OoAaPk1FGSMKm6qLe2fcuaWLE2wLqVb7Z52NvMTPTeOpyBArfF9OeXg8ahIrx2Jhj/vd A8xg== X-Gm-Message-State: AO0yUKUeDnq29Z7Uq+1Sajvtu+V3/2hy/hrC7df9apDJq5r657a++Jq7 8qTdKPVrwKP/HLzUdKl3OaIRe0tVcWkofA== X-Google-Smtp-Source: AK7set9tUXWjGwyleR7FBTXob7ilzeQVljpwQzgnPw9omptj99674rmMwBQP1OV9XDN1/Canu0y4Vw== X-Received: by 2002:a05:600c:3296:b0:3dd:dd46:1274 with SMTP id t22-20020a05600c329600b003dddd461274mr7239429wmp.4.1675878905139; Wed, 08 Feb 2023 09:55:05 -0800 (PST) Received: from ?IPv6:2001:8a0:f92b:9e00::1fe? ([2001:8a0:f92b:9e00::1fe]) by smtp.gmail.com with ESMTPSA id j14-20020a05600c190e00b003dcc82ce53fsm2925865wmq.38.2023.02.08.09.55.04 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Feb 2023 09:55:04 -0800 (PST) Subject: Re: [PATCH 1/3] gdb: don't print global thread-id to CLI in describe_other_breakpoints To: Andrew Burgess , gdb-patches@sourceware.org References: From: Pedro Alves Message-ID: <3696851d-d3a2-e18a-6108-0a945f6a56ae@palves.net> Date: Wed, 8 Feb 2023 17:55:03 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,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: On 2023-02-08 3:23 p.m., Andrew Burgess via Gdb-patches wrote: > I noticed that describe_other_breakpoints was printing the global > thread-id to the CLI. For CLI output we should be printing the > inferior local thread-id (e.g. "2.1"). This can be seen in the > following GDB session: > > (gdb) info threads > Id Target Id Frame > 1.1 Thread 4065742.4065742 "bp-thread-speci" main () at /tmp/bp-thread-specific.c:27 > * 2.1 Thread 4065743.4065743 "bp-thread-speci" main () at /tmp/bp-thread-specific.c:27 > (gdb) break foo thread 2.1 > Breakpoint 3 at 0x40110a: foo. (2 locations) > (gdb) break foo thread 1.1 > Note: breakpoint 3 (thread 2) also set at pc 0x40110a. > Note: breakpoint 3 (thread 2) also set at pc 0x40110a. > Breakpoint 4 at 0x40110a: foo. (2 locations) > > Notice that GDB says: > > Note: breakpoint 3 (thread 2) also set at pc 0x40110a. > > The 'thread 2' in here is using the global thread-id, we should > instead say 'thread 2.1' which corresponds to how the user specified > the breakpoint. > > This commit fixes this issue and adds a test. Approved-By: Pedro Alves