From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QEfNN53+PGA3JAAAWB0awg (envelope-from ) for ; Mon, 01 Mar 2021 09:47:57 -0500 Received: by simark.ca (Postfix, from userid 112) id DEFBF1EF78; Mon, 1 Mar 2021 09:47:57 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4F2E91E590 for ; Mon, 1 Mar 2021 09:47:55 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4799B393BC28; Mon, 1 Mar 2021 14:47:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4799B393BC28 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614610074; bh=w+VIpnczZsOJsNulm5EpEh6bUo0IP4XCxEa2MPjuTHU=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=VZTRfXDcE5XdoTIY/Eh8vUv4vlhG21Zsuwrgub3nKUhtM2pNrNJcMmz1+gD8rZ87+ uHOPq9Mp3okDGV6yJDg0HQkz/HZbP7/GwnSdRCdUDLLNx1HQ3lNjbQE0rfx2T38mGn GsD6zht8iYS5WOlxkt0qRKwG/LyvTgmD4LM057ZM= Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam08on2076.outbound.protection.outlook.com [40.107.102.76]) by sourceware.org (Postfix) with ESMTPS id E60FB3939C23 for ; Mon, 1 Mar 2021 14:47:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E60FB3939C23 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dliYiGxj0tRgFPe+uUJk5oLKpSqIiooA/48MrgG6yWMCsU0Z+f4PodyLynMYe5KK+XX0iPAaq2naKYk8iZNwFbeLxkvRg5kvSVxY1LzHayKDEC91xha6UFwuInuZWDVNAjm72Sl5HsFm1EaKyu93u+xBysMK6mG2+Vedvz8EO6vFm7Mx5R2OizWu4EqtFHBhXHG8oqttl5qpKssRtzZXRUU0mFkaw81GIVHATmuGGJHuUN0UUWM8wxLF04orte/FrLt16pJ+sVIs0G0B0WwHjuOoGGKDxwgM362XIJdV1oZAIJqgK6jK5G9z4tRTG6GE+KF9GGz7hjh3bJbOz+R7MQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w+VIpnczZsOJsNulm5EpEh6bUo0IP4XCxEa2MPjuTHU=; b=CtOf1zJn4UTn20A1kPTivdXiZGMO67pQ2s+WzQxXMea3BoxnsIXBChXfiNFfZ3TPBxTFeuLQ3hkuSAPUa0niaf1jtyqh9qb/8/UBznACfrsIUZ9Rh91Eo1Qfptji1qUVf2TRF96fE7b6lfq3xO0HTqxUhklnlRagqdDm2J1izZ+kxo6kGiklug3FMFY+WN+88X6Nuxdv3i3SG5c0MRIzXv8n3kbcIKCBKnlA5jTQRbReYgAnbCSqiCVgs8hOlRCLykGsn9sOJhZ/OD4NKn9l9camuUVLmbLLyhC8cT9RepMR0dbdZTxoqlT88zPyIJGfyRj1ikPtm/08D/oDADKJeQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none Received: from DM6PR12MB2762.namprd12.prod.outlook.com (2603:10b6:5:45::15) by DM5PR12MB2342.namprd12.prod.outlook.com (2603:10b6:4:ba::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.28; Mon, 1 Mar 2021 14:47:47 +0000 Received: from DM6PR12MB2762.namprd12.prod.outlook.com ([fe80::31d8:f503:f7b2:f44]) by DM6PR12MB2762.namprd12.prod.outlook.com ([fe80::31d8:f503:f7b2:f44%3]) with mapi id 15.20.3868.033; Mon, 1 Mar 2021 14:47:47 +0000 To: gdb-patches@sourceware.org Subject: [PATCH 34/43] Comments cleanup between expr.h and expr.c Date: Mon, 1 Mar 2021 14:46:11 +0000 Message-Id: <20210301144620.103016-35-Zoran.Zaric@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210301144620.103016-1-Zoran.Zaric@amd.com> References: <20210301144620.103016-1-Zoran.Zaric@amd.com> Content-Type: text/plain X-Originating-IP: [2a00:23c7:5a85:6801:b4ed:fe7b:8064:d4d] X-ClientProxiedBy: AM0PR04CA0073.eurprd04.prod.outlook.com (2603:10a6:208:be::14) To DM6PR12MB2762.namprd12.prod.outlook.com (2603:10b6:5:45::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2a00:23c7:5a85:6801:b4ed:fe7b:8064:d4d) by AM0PR04CA0073.eurprd04.prod.outlook.com (2603:10a6:208:be::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3890.19 via Frontend Transport; Mon, 1 Mar 2021 14:47:17 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: aac3b6c1-4440-48e6-1a64-08d8dcc0e98d X-MS-TrafficTypeDiagnostic: DM5PR12MB2342: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J0KMZAX9aH4swEk5MaV67LA1ii6jx6FA5j7irHs7Uw/4C3mjBtMPrpi8ytbQwSufrigAi3JEIiuIuzutviAKOmHm4b2rajrGS2jWdKaG/G0eqrvGEi2qBstzTqHBp2FkjisTHvu4VKTORhbqtvDTqvYSM6TIhf5MBReAUAxi/8I1UyMQHJkiVAvxIZ2PNjRW/40iQYtdo+qOGkyP0fYwcjmNivO39Pv6Sfrb3DonhkoLvOEeFYElt8UN224F6ib/1hsK/FoVoHRtqMZgJSn7Jjwnw5E+3WCQ7jiW8BoYX9HmboeRdL7ONEbPq93kT1LnMJTVTn9fXVw55zaElkuBKs8Z0fggq4S+jV7GVLk1GKXvEsXNVG/yL3lLwuGhdrHmUpciPkBg1jYEbExi1w3dR0iaSGDzTgjiXuguENFWGyBkJue0NZGFwhKSt3kkoCdB9mM3xyXgvOdo8SUlVEc0176Kqz0og7z2beidAj8Jpf73S8YsTDImTg1KLlK1p7HvyqNeO/kx79RbwhUd9Qk9qPzzeJMh7ixAI7jgtRpco1ObpSglPifySTfBhnlgzIkr+nid2A49iv3dUvD8W5gZHA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB2762.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(346002)(396003)(376002)(39860400002)(136003)(6486002)(66476007)(4326008)(478600001)(66556008)(2906002)(66946007)(69590400012)(316002)(52116002)(6666004)(6916009)(2616005)(86362001)(16526019)(6512007)(36756003)(8676002)(8936002)(6506007)(5660300002)(186003)(1076003)(83380400001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?DzpY83aIuzrBiz5BBV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ascii?Q?pbckvIxvdlwfeQYBGgjI9KxhxODZXfYmJK8enQoGAOGTBc+IZXxopO8wkdId?= =?us-ascii?Q?715VoXPNC2Nhg62x0ZDJHj16+UrecHA+/40hVBoQNzBt3KErp4uvjIArVWfK?= =?us-ascii?Q?5fBgmnFniVZYitg4V6++mL+w9d9jsKo+RW0QL5bjqYQAseZu5Bmr3Ea6zFEV?= =?us-ascii?Q?YPBfdepS7m1GyDHIVtA3Q5rdvV9GqHySv5xCvFwJK1LTrQMKttD7Kn+vc2v2?= =?us-ascii?Q?ERSPU5Iy+ONNfXQiI7KZbuRoIJnGv0eEzXT1T+OBZet4Hpp9rEBXowz7aMPZ?= =?us-ascii?Q?wgwMbJRFFG7TQHAplpbpt29wYhcv9F+r/y4TwUs396zRT0aTC5rnFRw7N9qf?= =?us-ascii?Q?eLUdKoVcSqPzQWwJamJsnU8EkUbtAeSgpj6F4Bo1V8wy4/KwOIb9V2TnUwGd?= =?us-ascii?Q?gjm8Q1CTxxGz06MQU+3H7uZmXrpAptz4eK5Hu/xKNM3GK9OZdXMWazp16a+W?= =?us-ascii?Q?C+L1dSynAiQksgvEbsfbNt/AKty2?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: aac3b6c1-4440-48e6-1a64-08d8dcc0e98d X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB2762.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Mar 2021 14:47:18.5753 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g+v5Gov31HF24VtyaNC4D5sU3yFs9R7E3mUtpt7t/QxIQ0uvt/BdLU1AYd7JzHfSk/xVeGwy0M1C6zRx/VHe9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB2342 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: , From: Zoran Zaric via Gdb-patches Reply-To: Zoran Zaric Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" This is just a cosmetic cleanup of the expr.h and expr.c documentation. gdb/ChangeLog: * dwarf2/expr.c: Comments cleanup. * dwarf2/expr.h: Comments cleanup. --- gdb/dwarf2/expr.c | 42 ++++++++++++++++------------------------ gdb/dwarf2/expr.h | 49 +++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 64 insertions(+), 27 deletions(-) diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index e45a7755ec5..aa28d632442 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -2241,7 +2241,7 @@ dwarf_expr_context::dwarf_expr_context (dwarf2_per_objfile *per_objfile, { } -/* Push ENTRY onto the stack. */ +/* See expr.h. */ void dwarf_expr_context::push (std::shared_ptr entry) @@ -2249,7 +2249,7 @@ dwarf_expr_context::push (std::shared_ptr entry) stack.emplace_back (entry); } -/* Push ADDR onto the stack. */ +/* See expr.h. */ void dwarf_expr_context::push_address (CORE_ADDR addr, bool in_stack_memory) @@ -2259,7 +2259,7 @@ dwarf_expr_context::push_address (CORE_ADDR addr, bool in_stack_memory) } -/* Pop the top item off of the stack. */ +/* See expr.h. */ void dwarf_expr_context::pop () @@ -2270,7 +2270,7 @@ dwarf_expr_context::pop () stack.pop_back (); } -/* Retrieve the N'th item on the stack. */ +/* See expr.h. */ std::shared_ptr dwarf_expr_context::fetch (int n) @@ -2506,7 +2506,7 @@ get_signed_type (struct gdbarch *gdbarch, struct type *type) } } -/* Return true if the expression stack is empty. */ +/* See expr.h. */ bool dwarf_expr_context::stack_empty_p () const @@ -2514,7 +2514,7 @@ dwarf_expr_context::stack_empty_p () const return stack.empty (); } -/* Add a new piece to the composite on top of the stack. */ +/* See expr.h. */ std::shared_ptr dwarf_expr_context::add_piece (ULONGEST bit_size, ULONGEST bit_offset) @@ -2550,7 +2550,7 @@ dwarf_expr_context::add_piece (ULONGEST bit_size, ULONGEST bit_offset) } -/* Evaluate the expression at ADDR (LEN bytes long). */ +/* See expr.h. */ void dwarf_expr_context::eval (const gdb_byte *addr, size_t len) @@ -2564,7 +2564,7 @@ dwarf_expr_context::eval (const gdb_byte *addr, size_t len) gdb_assert (this->recursion_depth == old_recursion_depth); } -/* Helper to read a uleb128 value or throw an error. */ +/* See expr.h. */ const gdb_byte * safe_read_uleb128 (const gdb_byte *buf, const gdb_byte *buf_end, @@ -2576,7 +2576,7 @@ safe_read_uleb128 (const gdb_byte *buf, const gdb_byte *buf_end, return buf; } -/* Helper to read a sleb128 value or throw an error. */ +/* See expr.h. */ const gdb_byte * safe_read_sleb128 (const gdb_byte *buf, const gdb_byte *buf_end, @@ -2588,6 +2588,8 @@ safe_read_sleb128 (const gdb_byte *buf, const gdb_byte *buf_end, return buf; } +/* See expr.h. */ + const gdb_byte * safe_skip_leb128 (const gdb_byte *buf, const gdb_byte *buf_end) { @@ -2597,9 +2599,7 @@ safe_skip_leb128 (const gdb_byte *buf, const gdb_byte *buf_end) return buf; } -/* Check that the current operator is either at the end of an - expression, or that it is followed by a composition operator or by - DW_OP_GNU_uninit (which should terminate the expression). */ +/* See expr.h. */ void dwarf_expr_require_composition (const gdb_byte *op_ptr, const gdb_byte *op_end, @@ -2627,8 +2627,7 @@ base_types_equal_p (struct type *t1, struct type *t2) return TYPE_LENGTH (t1) == TYPE_LENGTH (t2); } -/* If value); + + /* Push ENTRY onto the stack. */ + void push (std::shared_ptr entry); + + /* Return true if the expression stack is empty. */ bool stack_empty_p () const; + + /* Pop a top element of the stack and add as a composite piece + with an BIT_OFFSET offset and of a BIT_SIZE size. + + If the following top element of the stack is a composite + location description, the piece will be added to it. Otherwise + a new composite location description will be created and + the piece will be added to that composite. */ std::shared_ptr add_piece (ULONGEST bit_size, ULONGEST bit_offset); + + /* The engine for the expression evaluator. Using the context in + this object, evaluate the expression between OP_PTR and + OP_END. */ void execute_stack_op (const gdb_byte *op_ptr, const gdb_byte *op_end); + + /* Pop the top item off of the stack. */ void pop (); + + /* Retrieve the N'th item on the stack. */ std::shared_ptr fetch (int n); /* Fetch the result of the expression evaluation in a form of @@ -138,18 +166,32 @@ struct dwarf_expr_context read as an address in a given FRAME. */ CORE_ADDR read_addr_from_reg (struct frame_info *, int); +/* Check that the current operator is either at the end of an + expression, or that it is followed by a composition operator or by + DW_OP_GNU_uninit (which should terminate the expression). */ void dwarf_expr_require_composition (const gdb_byte *, const gdb_byte *, const char *); +/* If