From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x231.google.com (mail-oi1-x231.google.com [IPv6:2607:f8b0:4864:20::231]) by sourceware.org (Postfix) with ESMTPS id 943AC3858D28 for ; Mon, 25 Apr 2022 14:11:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 943AC3858D28 Received: by mail-oi1-x231.google.com with SMTP id b188so17172705oia.13 for ; Mon, 25 Apr 2022 07:11:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version; bh=nso52p5cvOjz57OKZ0M3af9PkrKgSc6seLImesvnbeA=; b=p9FmjB0rstFXsd0cx4BIB8YfU96Ltsh6bFdnW+3NgktsV0B6eFjfnYn6hPKyFQlWl4 OO3w91NAIcMSBl6ypP5U3JxpBYyFUN1UoI32puNrripcxRvAnheK3WUrRnr9kI2kQGy+ COmfCQeoy0YjhluaTn+tbLY+TUA5RWT7A14YGuEx5WIkxVUhxADXJtQnVKq6itXWiVJx COXep1T2Gobg2ks1HhEa7oGtTnFyDeVR5WqNhHJRjUrXNg6RtnRAr0y2sYEm5OhB0tOe CxcnZw8CTpeFJj5KFJ9zVLztVqbiL9BO0Cs9U70kuFrFlzYCiRXSydEt+Q7Yn/Apf6sj mdWQ== X-Gm-Message-State: AOAM530NhVuy60/f9RXwfA+S00PQB97fJIIdG8sHpSifwt8KeEQV0GXU 4RHVlw/ZAfd83qQpdW9wi7V8Fw== X-Google-Smtp-Source: ABdhPJzNoWHUPLKSwmxMMOXwET/6skRlaLPMmhvp4R93i2xK/9nTgDRPlFCPc5MS+cBqtzVfPafuaQ== X-Received: by 2002:a05:6808:1590:b0:322:a515:4624 with SMTP id t16-20020a056808159000b00322a5154624mr12706562oiw.164.1650895870802; Mon, 25 Apr 2022 07:11:10 -0700 (PDT) Received: from localhost ([2804:14d:7e39:8470:cb90:8084:f534:54ff]) by smtp.gmail.com with ESMTPSA id u7-20020a05687036c700b000da4bcdae42sm3221751oak.13.2022.04.25.07.11.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Apr 2022 07:11:10 -0700 (PDT) References: <20220118194007.2853108-1-tom@tromey.com> <20220118194007.2853108-5-tom@tromey.com> User-agent: mu4e 1.6.10; emacs 27.2 From: Thiago Jung Bauermann To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 04/36] Delete some unnecessary wrapper functions Date: Mon, 25 Apr 2022 11:08:05 -0300 In-reply-to: <20220118194007.2853108-5-tom@tromey.com> Message-ID: <87h76h8d8l.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 25 Apr 2022 14:11:14 -0000 Tom Tromey writes: > -static void > -bkpt_create_breakpoints_sal (struct gdbarch *gdbarch, > - struct linespec_result *canonical, > - gdb::unique_xmalloc_ptr cond_string, > - gdb::unique_xmalloc_ptr extra_string, > - enum bptype type_wanted, > - enum bpdisp disposition, > - int thread, > - int task, int ignore_count, > - const struct breakpoint_ops *ops, > - int from_tty, int enabled, > - int internal, unsigned flags) > -{ > - create_breakpoints_sal_default (gdbarch, canonical, > - std::move (cond_string), > - std::move (extra_string), > - type_wanted, > - disposition, thread, task, > - ignore_count, ops, from_tty, > - enabled, internal, flags); > -} The wrapper here does an std::move() of the string arguments. > -static void > -tracepoint_create_breakpoints_sal (struct gdbarch *gdbarch, > - struct linespec_result *canonical, > - gdb::unique_xmalloc_ptr cond_string, > - gdb::unique_xmalloc_ptr extra_string, > - enum bptype type_wanted, > - enum bpdisp disposition, > - int thread, > - int task, int ignore_count, > - const struct breakpoint_ops *ops, > - int from_tty, int enabled, > - int internal, unsigned flags) > -{ > - create_breakpoints_sal_default (gdbarch, canonical, > - std::move (cond_string), > - std::move (extra_string), > - type_wanted, > - disposition, thread, task, > - ignore_count, ops, from_tty, > - enabled, internal, flags); > -} Here too. > @@ -14487,8 +14427,8 @@ initialize_breakpoint_ops (void) > ops->insert_location = bkpt_insert_location; > ops->remove_location = bkpt_remove_location; > ops->breakpoint_hit = bkpt_breakpoint_hit; > - ops->create_sals_from_location = bkpt_create_sals_from_location; > - ops->create_breakpoints_sal = bkpt_create_breakpoints_sal; > + ops->create_sals_from_location = create_sals_from_location_default; > + ops->create_breakpoints_sal = create_breakpoints_sal_default; > ops->decode_location = bkpt_decode_location; > > /* The breakpoint_ops structure to be used in regular breakpoints. */ > @@ -14570,8 +14510,8 @@ initialize_breakpoint_ops (void) > ops->print_one_detail = tracepoint_print_one_detail; > ops->print_mention = tracepoint_print_mention; > ops->print_recreate = tracepoint_print_recreate; > - ops->create_sals_from_location = tracepoint_create_sals_from_location; > - ops->create_breakpoints_sal = tracepoint_create_breakpoints_sal; > + ops->create_sals_from_location = create_sals_from_location_default; > + ops->create_breakpoints_sal = create_breakpoints_sal_default; > ops->decode_location = tracepoint_decode_location; So shouldn't the callers of ops->create_breakpoints_sal () be changed to do the std::move() themselves? -- Thiago