From patchwork Mon Jul 1 18:02:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 33504 Received: (qmail 1391 invoked by alias); 1 Jul 2019 18:03:09 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 1332 invoked by uid 89); 1 Jul 2019 18:03:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-15.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_STOCKGEN, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-wr1-f44.google.com Received: from mail-wr1-f44.google.com (HELO mail-wr1-f44.google.com) (209.85.221.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 01 Jul 2019 18:03:07 +0000 Received: by mail-wr1-f44.google.com with SMTP id n9so14879502wru.0 for ; Mon, 01 Jul 2019 11:03:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=wPf5Ivuv/NIpx2ah7y0uD2qQ1d2jgoWv8NEqizqDr6I=; b=AjSJH+atfD2IlwH/O9jfq/6r/Sw9s8zghEFm1yWXHe+jaBKl0uLzjkW4FNMlcoZvrC yQUsk4iK/lrq4M+xLfEBWqZgJumj/bakQ62yDma6Nk/lcZj6qzBjSf+NbtufCfgeQRdx xM2l1ngQM/lUoGd/02PC/EMkqfXzgR89JSPcUBaDQtSN2HocMfuntwxzI3ZC0B4T420g 8+WYkJX2VzErk81pKc2BLFFgOt0RuH3fO0bVIRJQw8maV379ERX3Ut1afykQaI9Ctdb5 ERQg4ou4Je9bTBcYeyzCjh/Sj6nZSI28yJAoG0Z2RJ/WqytBcguaoHZahpm8xTC2hlAm GVuw== Return-Path: Received: from localhost (cust64-dsl91-135-5.idnet.net. [91.135.5.64]) by smtp.gmail.com with ESMTPSA id f7sm14051687wrv.38.2019.07.01.11.03.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jul 2019 11:03:04 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCHv2 1/2] gdb: Remove unneeded parameter from set_breakpoint_location_function Date: Mon, 1 Jul 2019 19:02:59 +0100 Message-Id: <4b2521dc5cecc0c83728219638aab3fc46133153.1562003938.git.andrew.burgess@embecosm.com> In-Reply-To: References: In-Reply-To: References: <20190701171213.GU23204@embecosm.com> X-IsSubscribed: yes The explicit_loc parameter in set_breakpoint_location_function is not useful. This parameter is set from two possible fields of the symtab_and_line used to create the breakpoint; the explicit_pc field, and the explicit_line field. First, the explicit_line field, this is not currently set for any breakpoint command, so will never be true. Next, the explicit_pc field. This can be true but will never be true at the same time that the sal->msymbol field is also true - the sal->msymbol is only ever set in linespec.c:minsym_found, which doesn't allow for explicitly setting the pc. The result of this is that if we are setting a breakpoint on an msymbol that could turn out to be an ifunc, then we will not also have either an explicit_pc or an explicit_line, this check can therefore be removed. There should be no user visible changes after this commit. gdb/ChangeLog: * breakpoint.c (set_breakpoint_location_function): Remove explicit_loc parameter. (momentary_breakpoint_from_master): Update call to set_breakpoint_location_function. (add_location_to_breakpoint): Likewise. --- gdb/ChangeLog | 8 ++++++++ gdb/breakpoint.c | 14 +++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c index 8422db8b571..9baef38a3de 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -7096,12 +7096,10 @@ set_raw_breakpoint_without_location (struct gdbarch *gdbarch, return add_to_breakpoint_chain (std::move (b)); } -/* Initialize loc->function_name. EXPLICIT_LOC says no indirect function - resolutions should be made as the user specified the location explicitly - enough. */ +/* Initialize loc->function_name. */ static void -set_breakpoint_location_function (struct bp_location *loc, int explicit_loc) +set_breakpoint_location_function (struct bp_location *loc) { gdb_assert (loc->owner != NULL); @@ -7113,8 +7111,7 @@ set_breakpoint_location_function (struct bp_location *loc, int explicit_loc) if (loc->msymbol != NULL && (MSYMBOL_TYPE (loc->msymbol) == mst_text_gnu_ifunc - || MSYMBOL_TYPE (loc->msymbol) == mst_data_gnu_ifunc) - && !explicit_loc) + || MSYMBOL_TYPE (loc->msymbol) == mst_data_gnu_ifunc)) { struct breakpoint *b = loc->owner; @@ -8482,7 +8479,7 @@ momentary_breakpoint_from_master (struct breakpoint *orig, copy = set_raw_breakpoint_without_location (orig->gdbarch, type, ops); copy->loc = allocate_bp_location (copy); - set_breakpoint_location_function (copy->loc, 1); + set_breakpoint_location_function (copy->loc); copy->loc->gdbarch = orig->loc->gdbarch; copy->loc->requested_address = orig->loc->requested_address; @@ -8587,8 +8584,7 @@ add_location_to_breakpoint (struct breakpoint *b, loc->msymbol = sal->msymbol; loc->objfile = sal->objfile; - set_breakpoint_location_function (loc, - sal->explicit_pc || sal->explicit_line); + set_breakpoint_location_function (loc); /* While by definition, permanent breakpoints are already present in the code, we don't mark the location as inserted. Normally one would expect