From patchwork Tue Nov 1 19:25:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 59757 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 2F9F63858427 for ; Tue, 1 Nov 2022 19:26:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F9F63858427 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1667330794; bh=nf3PHnLntRYEsOq+0CeFeLFoTgW0L0mEzdMBOauGGjI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=q8m0ZhXNIm51vZxB4I4z7TeIw7Qr2hamsXARJWP3bscq/pI+Tea9Tw/o1VPHjUfvp xRgHdOghy4YzwFZgOnc/Cm4EcUvJ8ByNe5k+5l6nqPjn7nzdq4bIW0K3irx88Is3te pR4CiWbZ2dDxujX5iG77kDQ7IFUVMvrfD2bZLFfI= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-il1-x12e.google.com (mail-il1-x12e.google.com [IPv6:2607:f8b0:4864:20::12e]) by sourceware.org (Postfix) with ESMTPS id 7E31F3858414 for ; Tue, 1 Nov 2022 19:26:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 7E31F3858414 Received: by mail-il1-x12e.google.com with SMTP id h18so8325578ilq.9 for ; Tue, 01 Nov 2022 12:26:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=nf3PHnLntRYEsOq+0CeFeLFoTgW0L0mEzdMBOauGGjI=; b=54mAm+YdnFQVuEOSM6140VXxG1rUcJw2RL2hh3iKYTePpqh+PaNp85+DWqYfsagmT9 Gj1bl3wCbFpCHSRDcobGeN112d2lyjwhiL4j0+n7NAxlsz4xec3XYnm6pEzR4mnsnCMX WjFhgx+g602o+YUk+SzYsWFQwYxBIN1TTARJr1rNamPSi8c2amm/XrR9iR1UKShYSy4U q4WnHCdHWpsSRXVvIKGR/MUz7FxcKYboCLi6v/3Kv2ZU4Mw5Cug4rGBSO239F4u+VlRI 4YEOm/JbVPic7gVOf5i73vEWCHLBM6Df2fdif13k0yfi+4Pu+001S0vhLs4RXtz9yNYU RncA== X-Gm-Message-State: ACrzQf24PXWHPAL184z9bVgPeqySeRZ2aZg7z9c8ja4etf4HALT6tBsH 9x085JEnT+qP6oCM9ze8FOM8xFGHEtfnfg== X-Google-Smtp-Source: AMsMyM4IViBPbis6rrAZ50Vq9Phy4Rdyvo9MjHQ73zFucTeavVcdZhvICNzCigF+ycqh4TaC7uXh+Q== X-Received: by 2002:a05:6e02:787:b0:300:c853:a24e with SMTP id q7-20020a056e02078700b00300c853a24emr1409519ils.59.1667330764708; Tue, 01 Nov 2022 12:26:04 -0700 (PDT) Received: from localhost.localdomain (97-122-76-186.hlrn.qwest.net. [97.122.76.186]) by smtp.gmail.com with ESMTPSA id cq6-20020a056638478600b003757ab96c08sm340928jab.67.2022.11.01.12.26.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 12:26:04 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH] Remove dump_prefix_expression Date: Tue, 1 Nov 2022 13:25:56 -0600 Message-Id: <20221101192556.763240-1-tromey@adacore.com> X-Mailer: git-send-email 2.34.3 MIME-Version: 1.0 X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Cc: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" Since the expression rewrite, dump_prefix_expression has been misnamed. This patch cleans this up by removing the function, turning it into a method on struct expression. --- gdb/expprint.c | 6 ------ gdb/expression.h | 8 ++++++-- gdb/parse.c | 2 +- gdb/stap-probe.c | 2 +- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/gdb/expprint.c b/gdb/expprint.c index 8534d2ac443..914177a122e 100644 --- a/gdb/expprint.c +++ b/gdb/expprint.c @@ -59,12 +59,6 @@ op_name (enum exp_opcode opcode) } } -void -dump_prefix_expression (struct expression *exp, struct ui_file *stream) -{ - exp->op->dump (stream, 0); -} - /* Meant to be used in debug sessions, so don't export it in a header file. */ extern void ATTRIBUTE_USED debug_exp (struct expression *exp); diff --git a/gdb/expression.h b/gdb/expression.h index 3ba68a2db93..a56b1856cda 100644 --- a/gdb/expression.h +++ b/gdb/expression.h @@ -208,6 +208,12 @@ struct expression return op->opcode (); } + /* Dump the expression to STREAM. */ + void dump (struct ui_file *stream) + { + op->dump (stream, 0); + } + /* Evaluate the expression. EXPECT_TYPE is the context type of the expression; normally this should be nullptr. NOSIDE controls how evaluation is performed. */ @@ -277,8 +283,6 @@ extern struct value *evaluate_subexp_do_call (expression *exp, extern const char *op_name (enum exp_opcode opcode); -extern void dump_prefix_expression (struct expression *, struct ui_file *); - /* In an OP_RANGE expression, either bound could be empty, indicating that its value is by default that of the corresponding bound of the array or string. Also, the upper end of the range can be exclusive diff --git a/gdb/parse.c b/gdb/parse.c index aa12f6fe012..bfd9de09a10 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -527,7 +527,7 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc, result->op->set_outermost (); if (expressiondebug) - dump_prefix_expression (result.get (), gdb_stdlog); + result->dump (gdb_stdlog); if (completer != nullptr) *completer = std::move (ps.m_completion_state); diff --git a/gdb/stap-probe.c b/gdb/stap-probe.c index 7e3d26bc849..6f91d87846a 100644 --- a/gdb/stap-probe.c +++ b/gdb/stap-probe.c @@ -1328,7 +1328,7 @@ stap_probe::parse_arguments (struct gdbarch *gdbarch) expression_up expr = stap_parse_argument (&cur, atype, gdbarch); if (stap_expression_debug) - dump_prefix_expression (expr.get (), gdb_stdlog); + expr->dump (gdb_stdlog); m_parsed_args.emplace_back (bitness, atype, std::move (expr));