From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by sourceware.org (Postfix) with ESMTPS id 1357F3856DC1 for ; Mon, 30 May 2022 15:32:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1357F3856DC1 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-f42.google.com with SMTP id x17so6071836wrg.6 for ; Mon, 30 May 2022 08:32:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=wCaNIfMr8AK1W745BJwbHBlKM6F+lGNezjJ3lDS4E7w=; b=IS/lBaXST4o0VsIMLaSNIlsWsqp9yK4NZEOCEGO9xm/3lTzLZdQcCF1XrW4DbUFB3i da6fxrjo4KBJTlL9lxUkw6Pt3o4mtwr6IDVqEjAQUGNO6U6aa/Qwyl5aNQJvDuk8M353 bj2M/t0Wq5tpsmY8IjJKpSg9DnDcx+vtLzonG2qarn/vVK7bLFj2RFJs+EUrh5U/d+yz 73QyJJ9hfWSb773fvz8YbPM/pH/i7kRy/rxas4diqDYRY2WFBiC2Waa6fYilxfDzGJmh 9Q7bApTv60UpnZ+aryp8mniQ6c4sVEnjJLf4fRbbtCzETo39gqcUZIQECWsqFVjfoQyB x10w== X-Gm-Message-State: AOAM533+yOrZIZBJ3kLrXvwxj0Jj1QrTU/klB4IQAFrZBKeSwA8vpn3a brpki5pMf4ZQnPLP7+5pUP/Cu736etY= X-Google-Smtp-Source: ABdhPJx33X0pJVI4tPAOUU3GG+0vQKfj0Mj7U8etI13TeOgeeT1njYgsAmuJ5PLDtBas+ZwQLESa0A== X-Received: by 2002:a5d:5310:0:b0:20f:d075:a386 with SMTP id e16-20020a5d5310000000b0020fd075a386mr35416786wrv.619.1653924740055; Mon, 30 May 2022 08:32:20 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id k36-20020a05600c1ca400b003942a244f57sm11403935wms.48.2022.05.30.08.32.17 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 May 2022 08:32:18 -0700 (PDT) Message-ID: Date: Mon, 30 May 2022 16:32:16 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH 2/3] Change location_to_sals to a method Content-Language: en-US To: Tom Tromey , gdb-patches@sourceware.org References: <20220528024231.474534-1-tom@tromey.com> <20220528024231.474534-3-tom@tromey.com> From: Pedro Alves In-Reply-To: <20220528024231.474534-3-tom@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.2 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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2022 15:32:22 -0000 On 2022-05-28 03:42, Tom Tromey wrote: > > @@ -12673,26 +12674,26 @@ location_to_sals (struct breakpoint *b, struct event_location *location, > { > for (auto &sal : sals) > resolve_sal_pc (&sal); > - if (b->condition_not_parsed && b->extra_string != NULL) > + if (condition_not_parsed && extra_string != NULL) > { > - gdb::unique_xmalloc_ptr cond_string, extra_string; > + gdb::unique_xmalloc_ptr local_cond, local_extra; > int thread, task; These thread/task are masking the breakpoint fields, and then ... > > - find_condition_and_thread_for_sals (sals, b->extra_string.get (), > - &cond_string, &thread, > - &task, &extra_string); > - gdb_assert (b->cond_string == NULL); > - if (cond_string) > - b->cond_string = std::move (cond_string); > - b->thread = thread; > - b->task = task; > - if (extra_string) > - b->extra_string = std::move (extra_string); > - b->condition_not_parsed = 0; > + find_condition_and_thread_for_sals (sals, extra_string.get (), > + &local_cond, &thread, > + &task, &local_extra); > + gdb_assert (cond_string == nullptr); > + if (local_cond != nullptr) > + cond_string = std::move (local_cond); > + thread = thread; > + task = task; ... here you end up with self assignments.