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 8A3D03858414 for ; Fri, 10 Feb 2023 19:22:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A3D03858414 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=1676056938; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=J09DxgY5VMiGAN9/4XBPNWw2dcmvP/b1cRnnPef2qss=; b=KWG3I/Bnara4dMc7aWAI5S15rD9kxF/156eVeeBWdZlzacGeKhrr5IytsjjD0rhSp5EkUg h4Dryf6vtcz8dZp6FSTDqtA9POtLVn/tSPvQP/j/cZC01O880ZTH1Wk2ZNFf9nDY2E4fEL OhG7PbTqKMjp0aQZzWE0kAl/xhfIXGU= Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-583-t-nJRhduPdmL2hUJ0FXO6A-1; Fri, 10 Feb 2023 14:22:16 -0500 X-MC-Unique: t-nJRhduPdmL2hUJ0FXO6A-1 Received: by mail-qt1-f197.google.com with SMTP id bz17-20020a05622a1e9100b003b9c1013018so3659931qtb.18 for ; Fri, 10 Feb 2023 11:22:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=J09DxgY5VMiGAN9/4XBPNWw2dcmvP/b1cRnnPef2qss=; b=GkJji10bGREWW9K11fiCNYKzaPKOvAvboC9cvgTSgN8GaLzz0p7BQ8MLcuc0wT1a2O D6s6PQtKSvmiPpOD7VGJRkeNXfuCOgf3hik0EfHKXqqIs559Gnx33W0OdwUXDNE5dBWm Risp85SHmWPRXE4IUBvP4oaakQjrmZa/nbMiokt57vCWsKiKtArtqwBMFjUjlKte6Wki O8ntX5jEodmo+kHuN1IRia1ziqn/Unj+YrUMQJNTdZO6w3wB99xXMx4Ls3ZeUsn5nRIJ kGV1eY+mgVvugfn19iFAzrpanOHb/rwpszV6BgzYQ/QN2JPiGwqYopYndinuy4VbMG1A sCYg== X-Gm-Message-State: AO0yUKVSBhS0NtzgqaPf9vnEkz7mgxr3fZJFU6hq4g2mOqGEyY/KOk/x THuzEFwZW+sqsLpGJr/GOniLxLG+Yu+SnAwNPvfWFpFlg4pdyZTKjyYYmRXj15hIiaKYZPg57sn AZLM+2QxrEJ88+o3QJPpiXUjlo7U= X-Received: by 2002:a05:622a:4cf:b0:3b8:3171:4a8e with SMTP id q15-20020a05622a04cf00b003b831714a8emr22570796qtx.59.1676056935771; Fri, 10 Feb 2023 11:22:15 -0800 (PST) X-Google-Smtp-Source: AK7set8DfOtbbzQQJ5eANhTNzG5kgGrboptEH3VPCcJOGeJx9hbVRldaZ78JBlqynx2aq+rj+CkQbw== X-Received: by 2002:a05:622a:4cf:b0:3b8:3171:4a8e with SMTP id q15-20020a05622a04cf00b003b831714a8emr22570772qtx.59.1676056935495; Fri, 10 Feb 2023 11:22:15 -0800 (PST) Received: from localhost (95.72.115.87.dyn.plus.net. [87.115.72.95]) by smtp.gmail.com with ESMTPSA id p18-20020ac84092000000b003a7eb5baf3csm3890562qtl.69.2023.02.10.11.22.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Feb 2023 11:22:15 -0800 (PST) From: Andrew Burgess To: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCH 3/3] gdb: don't use the global thread-id in the saved breakpoints file In-Reply-To: <22df7afc-cf88-d260-516d-7b9a45e2ad78@palves.net> References: <22df7afc-cf88-d260-516d-7b9a45e2ad78@palves.net> Date: Fri, 10 Feb 2023 19:22:13 +0000 Message-ID: <87pmahuxzu.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-Spam-Status: No, score=-5.7 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_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: Pedro Alves writes: > On 2023-02-08 3:23 p.m., Andrew Burgess via Gdb-patches wrote: > >> breakpoint::print_recreate_thread (struct ui_file *fp) const >> { >> if (thread != -1) >> - gdb_printf (fp, " thread %d", thread); >> + { >> + struct thread_info *thr = find_thread_global_id (thread); >> + gdb_printf (fp, " thread %s", print_thread_id (thr)); > > print_thread_id only prints the inferior-qualified thread id if > there are multiple inferiors. I am wondering whether the save breakpoints > file should _always_ end up with inferior-qualified thread ids, so that > reloading the saved file works the same if you meanwhile add another > inferior. As a counter argument; if the user has a single inferior and places breakpoints on a particular thread, we'll have a save like: break foo thread 2 Then if the user sets up two inferiors, they can select which inferior the breakpoints should apply to - source the saves from inferior 2, and the b/p will apply to inferior 2 threads, source from inferior 1, and the b/p will apply to inferior 1 threads. If the user has changed the inferior setup when sourcing the breakpoint save file, I think they have to take some responsibility for knowing what they want ... maybe? If you feel strongly then it's easy enough to print the qualified thread-id, just let me know and I'll get it done. Thanks, Andrew > > Otherwise, > > Approved-By: Pedro Alves