From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f51.google.com (mail-wr1-f51.google.com [209.85.221.51]) by sourceware.org (Postfix) with ESMTPS id D31823851ABF for ; Fri, 17 Mar 2023 18:01:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D31823851ABF 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-wr1-f51.google.com with SMTP id t15so5202634wrz.7 for ; Fri, 17 Mar 2023 11:01:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679076080; 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=75ec2FA1CS0q3IjjHWppn/hN2Gbm4PJtEjy52nSDco0=; b=5ASTZvtvekBg+S8cFDg/sh69ExDo8TrTxyPbUQV6Uz4MFBfKuCQLp4hC0M2nSy5kAP EOObjLTOPGakVMV1Nb2vClzFhLudst2QvGHnmgM9cVaSUdJhpxZ1lOGh7waVcSx3Unfu ayzZiHI+V5YM/4bSHWGpP6PndPyBh71XKsqPIK53WvxX64v3mE11obvJSFjrUb3JaFNC Ge4oNtKRYSlF4loNQstEt0+w4uCOH/AmAx4+78hZDPrAsY1XzZ3vTYI/bt5xbHLXPwPR X9maE8pwGq+Gje9lvJxv5VrHiPgwAosEpCubwIHNdSDRdCb9UDQ/FEhFea4EK2VMmbcO 1MEg== X-Gm-Message-State: AO0yUKWRXR99HxlAN4ZMG18jSLUU5B1sgYBbz35kAbyxo7qxW0sLbu3g 5N5PC2gAn8KkLxPFZ51Fbcd/FYeLWZQ= X-Google-Smtp-Source: AK7set/2LrzqWhEcatAgCcuvAycpqspJDeoKll9ZwEAYdG9ljZU9l0hk8xOoAnKlKozu+aB8EkdhkA== X-Received: by 2002:adf:ff8b:0:b0:2d2:39d3:ce73 with SMTP id j11-20020adfff8b000000b002d239d3ce73mr3586481wrr.32.1679076079848; Fri, 17 Mar 2023 11:01:19 -0700 (PDT) Received: from ?IPv6:2001:8a0:f93c:5900::1fe? ([2001:8a0:f93c:5900::1fe]) by smtp.gmail.com with ESMTPSA id b7-20020a5d4d87000000b002c707785da4sm2478341wru.107.2023.03.17.11.01.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 17 Mar 2023 11:01:19 -0700 (PDT) Subject: Re: [PATCH 3/3] gdb: don't use the global thread-id in the saved breakpoints file To: Andrew Burgess , gdb-patches@sourceware.org References: <22df7afc-cf88-d260-516d-7b9a45e2ad78@palves.net> <87pmahuxzu.fsf@redhat.com> <00607ab6-b94c-869c-5d1a-7528cf4dd85f@palves.net> <87o7pej3ir.fsf@redhat.com> <87ttykeid0.fsf@redhat.com> From: Pedro Alves Message-ID: <1e720fd6-58d5-a478-847c-8e56f46d0e8e@palves.net> Date: Fri, 17 Mar 2023 18:01:21 +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: <87ttykeid0.fsf@redhat.com> 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=no 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-03-16 5:06 p.m., Andrew Burgess wrote: > Andrew Burgess writes: > >> Pedro Alves writes: >>> >>> On 2023-02-10 7:22 p.m., Andrew Burgess wrote: >>>> Pedro Alves writes: >>> My thinking is that internally, the thread is really inferior-qualified. >>> It is just a presentation detail in the CLI that we don't print the >>> inferior when there's only one inferior, for backwards compatibility. >>> That may even change in the future. An MI frontend / GUI may be presenting >>> the qualified ID, for instance. >>> >>> It seems to be that there are two valid approaches: >>> >>> #1 - we consider what the user typed when the breakpoint was created as canonical, >>> and thus we save the breakpoint using the same breakpoint spec string that >>> user typed originally, meaning, if the user typed: >>> >>> "break foo thread 1" >>> >>> then that's what we'd save, even if the user added a second >>> inferior after creating the breakpoint. >>> >>> Of course, it follows then that if the breakpoint is created with >>> >>> "break foo thread 1.1" >>> >>> then that's what we save. So the user would have the option. >>> >>> I'm really not sure whether this is an option that we should be giving >>> users, though. What if the breakpoint was created via Python, or via the >>> MI with --thread ? Then the concept of original "thread" may not even exists, >>> even though we save such a breakpoint too. >>> >>> #2 - we consider that the thread that the breakpoint ended up bound to is what >>> is canonical and thus we always print the qualified id to the file. >>> >>> The approach in your patch is neither of the above -- it prints the qualified >>> or non-qualified thread id depending on a CLI presentation detail, which seems >>> brittle to me. >>> >>> Option #2 seems the simplest to explain, document, and implement, to me, >>> but I could be convinced to go with #1 too. >> >> Thanks for the explanation. I've implemented #2 in the patch below, >> what are your thoughts? Sorry for the delay. (I simply forgot to reply.) It looks good to me. > > I'm planning to push this patch some time next week unless someone > objects. >