From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) by sourceware.org (Postfix) with ESMTPS id 9137F3828901 for ; Fri, 27 May 2022 18:03:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 9137F3828901 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-f49.google.com with SMTP id t20so849638wrh.11 for ; Fri, 27 May 2022 11:03:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=nsodOzYV4R/sLwQURcyqAQuEc8PRkoN9CTvl9nZs5qE=; b=dYdZ2F18AUuLvLyXy4OzZbNV4x3apNNw9BZlieuRJ/IJgTEVc68hmHURrTNlLBinTw eH5R8j46L425onhX6nWMzPbT6dCxxBnuZpWsLxGBEIJ0hroZwtezzLp3ucenFxt8TWK8 cEb1n61ybgkkdbCv/AnQerZwATBCeUf6m5TACo6Zm9N04//0JnwR2vXvaYTJDav/bYYd GoonQLxwV3B8XnRggtjyvFIIrsbEzkbj7wG6B8x32hzc40MabEQ8FNdt3S8gfbc7lBvj QcscCA0nYXx3ZX6B9BAcQ1JbRaxk2+ekBWxJlYtvdsxKpUpYHNmhWh18FXlVyPeeb8gc Tc4w== X-Gm-Message-State: AOAM533J+PTNQqzECNtE820t+7TTkkd0fRMLpItYsILt26FOTI7H1kEC JkHxBuvknulV9lKU99i9smiSg4u/+bQ= X-Google-Smtp-Source: ABdhPJyYy9Cwyy4aBwbLcmjdse+93IgjZiHlXNotGn+4AXEUthS+0CF5uwwB0fw5E0KnEwzoSEiWWw== X-Received: by 2002:adf:eb42:0:b0:20f:ebc5:cb0f with SMTP id u2-20020adfeb42000000b0020febc5cb0fmr18456191wrn.355.1653674583704; Fri, 27 May 2022 11:03:03 -0700 (PDT) Received: from localhost ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id e9-20020adfe389000000b0020c5253d8fcsm2735510wrm.72.2022.05.27.11.03.02 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 May 2022 11:03:02 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 4/7] Convert location_spec_empty_p to a method Date: Fri, 27 May 2022 19:02:45 +0100 Message-Id: <20220527180248.2990723-5-pedro@palves.net> X-Mailer: git-send-email 2.36.0 In-Reply-To: <20220527180248.2990723-1-pedro@palves.net> References: <20220527180248.2990723-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, 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: Fri, 27 May 2022 18:03:08 -0000 This converts location_spec_empty_p to a method of location_spec, simplifying users, as they no longer have to use std::unique_ptr::get(). Change-Id: I83381a729896f12e1c5a1b4d6d4c2eb1eb6582ff --- gdb/breakpoint.c | 3 +-- gdb/location.c | 10 +--------- gdb/location.h | 4 ---- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 403b70067d7..ea54c6c161b 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -3699,8 +3699,7 @@ create_exception_master_breakpoint (void) static int breakpoint_location_spec_empty_p (const struct breakpoint *b) { - return (b->locspec != nullptr - && location_spec_empty_p (b->locspec.get ())); + return (b->locspec != nullptr && b->locspec->empty_p ()); } void diff --git a/gdb/location.c b/gdb/location.c index 19b58ab4f5b..ae056f35296 100644 --- a/gdb/location.c +++ b/gdb/location.c @@ -855,7 +855,7 @@ string_to_location_spec (const char **stringp, /* If the user really specified a location spec, then we're done. */ - if (!location_spec_empty_p (locspec.get ())) + if (!locspec->empty_p ()) return locspec; /* Otherwise, the user _only_ specified optional flags like @@ -876,14 +876,6 @@ string_to_location_spec (const char **stringp, /* See description in location.h. */ -int -location_spec_empty_p (const location_spec *locspec) -{ - return locspec->empty_p (); -} - -/* See description in location.h. */ - void set_location_spec_string (struct location_spec *locspec, std::string &&string) diff --git a/gdb/location.h b/gdb/location.h index f52469d770f..2b825ef0cb0 100644 --- a/gdb/location.h +++ b/gdb/location.h @@ -363,10 +363,6 @@ extern location_spec_up const struct language_defn *language, explicit_completion_info *completion_info); -/* A convenience function for testing for unset location specs. */ - -extern int location_spec_empty_p (const location_spec *locspec); - /* Set the location specs's string representation. */ extern void set_location_spec_string (struct location_spec *locspec, -- 2.36.0