From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id kJ8ZFvF7zl9ETQAAWB0awg (envelope-from ) for ; Mon, 07 Dec 2020 14:01:05 -0500 Received: by simark.ca (Postfix, from userid 112) id 538C81EFBB; Mon, 7 Dec 2020 14:01:05 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,RDNS_NONE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [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 664831F071 for ; Mon, 7 Dec 2020 14:01:04 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 84DFF3951825; Mon, 7 Dec 2020 19:01:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 84DFF3951825 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1607367663; bh=PMxPnznkWACr/uaKrhXGM/pTxu4i2bkke+AKJa7I74A=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=EMraPn3NzCqHjuiuHReUzVnTJl4iqcMc4/UoMWAMiG3ESO0Z30nEts2XGrE/FeRIr beRMn58I08Cj262BMIFUfStM02cLmwoNwJMJfF/INrh2Z80UrNrPZafaKqpjbBGZmT m2qyZBoBfixMi6YIJuCDl2NKc6Dx1rMDa1p0P+lU= Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2049.outbound.protection.outlook.com [40.107.244.49]) by sourceware.org (Postfix) with ESMTPS id 6B0AC3951438 for ; Mon, 7 Dec 2020 19:01:00 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6B0AC3951438 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jJklTOMj2JYAcwa3h0W4tcZVeWGkBySc00Q2hhf+bbjbSU8LkSl15cOHPEUWYqnoBb/qxqwqdrqWiuyraARJ3X2DgQUAKrLWsMrEeiexnK1nl7C7XoIqOZgrXJTUa1YzucjiJ3ucwM6phTMv1ic8/iSH9DGawQZ02Moe4/fx4Fk20CP/ZRQF67tmPst4LmVuM9DJCSWF6RgEq5L6Uok+YQ/9vQ0vjrB++M5JZn6FVovHxe3wvBZBtVwvwikEU0l2oRLP2J0+ZS9nhURiJq9Gb9tpvWxDAHiVgsME2ElYkw3yP0sn/KOIshM8KVZvg0y71F8duLB/joWRS8qQN50tAw== 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=PMxPnznkWACr/uaKrhXGM/pTxu4i2bkke+AKJa7I74A=; b=AOAqrqb70F74YzLFwMBESaYkaogqRIMfmi4Bu09cC9uW7LUb3t0cUmSQ/67zjZ+Q8c1IOI0L1HM9VghjvlT0UEYISrrJYmUIZ3BrE7QcNFgKrgeE7RHpfWXgq1sU5tgnha1LdPBIqAQtLQ0OTu4V5yH6D+KufpAHdxfpM48WKQKhXuvdh7BPl6UNW82RY+j/cDEmipFWC818R7RDcb8WqGBgVAVgCVuYa6OozEAaEFHQpkJBAo3/kGmybS8rGRVduuGplxYCm1wJl7MNNXufI0rKMlN8sGOuhN+v3TugbG7Ln3nZADBIdKlC0Bvsdz1oiyQh3RQWMbbi54Ax3aCPOw== 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 DM6PR12MB4561.namprd12.prod.outlook.com (2603:10b6:5:2ac::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.18; Mon, 7 Dec 2020 19:00:56 +0000 Received: from DM6PR12MB2762.namprd12.prod.outlook.com ([fe80::6841:61df:984b:b3c]) by DM6PR12MB2762.namprd12.prod.outlook.com ([fe80::6841:61df:984b:b3c%3]) with mapi id 15.20.3632.021; Mon, 7 Dec 2020 19:00:56 +0000 To: gdb-patches@sourceware.org Subject: [PATCH 04/30] Move compilation unit info to dwarf_expr_context Date: Mon, 7 Dec 2020 19:00:05 +0000 Message-Id: <20201207190031.13341-5-Zoran.Zaric@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201207190031.13341-1-Zoran.Zaric@amd.com> References: <20201207190031.13341-1-Zoran.Zaric@amd.com> Content-Type: text/plain X-Originating-IP: [2a00:23c7:5a85:6801:5c7:2db6:d2c2:ae4e] X-ClientProxiedBy: AM4PR0101CA0053.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::21) 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:5c7:2db6:d2c2:ae4e) by AM4PR0101CA0053.eurprd01.prod.exchangelabs.com (2603:10a6:200:41::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3632.17 via Frontend Transport; Mon, 7 Dec 2020 19:00:55 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 9b387103-c3ad-441d-b747-08d89ae26d74 X-MS-TrafficTypeDiagnostic: DM6PR12MB4561: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:111; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: H8H8bnQGIAI7KRBzmByVe5rPQlDuXEtlEOoXv31LtXLSunxYMp6QLrA36Ket2sY7TOB3TbxBySZ0Cnb0pkmIzLf8EGijBK14mrf4Sv209H+YA6OaKlI+GJ3kA3J3JRB4PJwcm1Yb3Jm5dsyOr8rYM+9FURSi0WDjS3hPB67rfWaxBckEcd3Qe2Ez92qq/oN+B3pvdkT3dD8xHV5Udh7zR1jTy4+e0PhOQhnj8DMkPWdqzrtWpwtQff3pf7tE8yWVo7KoYeViSzXzKNPoFUnydnBAeBEfEeyr6erb1o/2TseeVkAqypuitQBuQ761ssHYuF5F8uvdCVetPAzhKhrOUgKCHOJ4OtWRtNjfdpcPbTnMoTu1NL6Wpju2nVDsagXx 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)(376002)(346002)(39860400002)(366004)(136003)(396003)(1076003)(30864003)(83380400001)(86362001)(6506007)(4326008)(69590400008)(52116002)(36756003)(2906002)(6512007)(8676002)(6486002)(16526019)(2616005)(66946007)(66476007)(66556008)(6916009)(5660300002)(186003)(8936002)(478600001)(6666004)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?us-ascii?Q?u+RrDLO9Eqr7ecszqAnSPBD5e5Z7Pf846/ihRdpOZARlPm+hWEnm/l69cIgu?= =?us-ascii?Q?TgU9gUlsXNRZczBDexjAR67GwPS0R2qghBpulva0nNleVn7byrWkYRBeoysQ?= =?us-ascii?Q?+SzlZ2gzAF9GnsZkdnmTdLc5VsbvgnHO51zg2y1BF6/tMESXD5cma1Hhedo2?= =?us-ascii?Q?8/uCE57x2aoeWEaGMfJ3AvX2G9KI7PX9iJKOruqOVnZuqM0VeelQDi2oXWlm?= =?us-ascii?Q?B+3H4EwsSRSm0O0pKmJiXL23dCFH94DmrA7/R5WY9CqlJKGRh3v6F+ecKTE3?= =?us-ascii?Q?vKBMOqeepgUA1ptwltZJS0RRhJkoWgMLMi5h01GT1Tt09oOETU2Kqu9Kbi/c?= =?us-ascii?Q?rK0ppjWfMp6YlDUw2F27ntNwAnm68Gnrbe28pZ86ltM7oHH41hb0ltERf/Lt?= =?us-ascii?Q?AgYO7fjA6BJ8c1mfruIb7cESeg1aT1RSxnOa3InCcRotTfMh8dEkEmcBK3Yq?= =?us-ascii?Q?CNr0uaU09X/3ssWuBIFd7ZEB3zuSimlMKkNLNG3yBUrogFKs1cZFps1qaCYw?= =?us-ascii?Q?YdMoMcqLHp9qks9UPYg4wHiiNfEQjE0QBv5K3HOaM8kA77RJfuXaw9Sdlfg4?= =?us-ascii?Q?oAxyN3TdXENTtuIr1RcE7/LOnxOxHh/PGWZLgcG+S4SjMDiZcqWwR1f9pvgi?= =?us-ascii?Q?LAUWJA2EGAztUhgpPEvG7Aje4RGmUlK74Z2Wfocs0Nh15M66jxUC0Z3v95+3?= =?us-ascii?Q?rGnFZfHDfGugHROUHByFleQy/0hVPzkOrDWeQ9o15f++8NnWCakJf4o5TxIW?= =?us-ascii?Q?RvXFBqi/W1cgMfm8QWWDuCBDSVY+h/RxEDT6IfPCxJLPzJSBAYfOLfb01A0w?= =?us-ascii?Q?9Do9MKCoz4hQGqnCgO4OCuedQm9hv5hNx78pKxSoA3zeQ65i9+y+qaQfuB/0?= =?us-ascii?Q?rgSTm/cIFD4BwQ2uDMmc2y35TE1GZBpr422zc7P9shknL3tEDQfA4cq1hihd?= =?us-ascii?Q?7b3w4K57KPLirnjgaumIO5rnjGQi449e9g2PJQtsWHE6FGROSticsXOxuKvR?= =?us-ascii?Q?0ps9rYQdHFxEKykqgwPE0SqHsZpeUY62iMIZKCskoEL2+m4omDVZWbrVsX0N?= =?us-ascii?Q?NeuzRKFh?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB2762.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2020 19:00:56.1947 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-Network-Message-Id: 9b387103-c3ad-441d-b747-08d89ae26d74 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 3mh45KuWhl2LH3kRhFvkhDoLgSx0b9VFrXyqFS0eE/i7Ef/jwmw/ggb5slBzFCb5aF5w5fppWnHNIW5NwkeFyQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4561 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 Cc: Zoran Zaric Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" From: Zoran Zaric This patch moves the compilation unit context information and support from dwarf_expr_executor and dwarf_evaluate_loc_desc to dwarf_expr_context evaluator. The idea is to report an error when a given operation requires a compilation unit information to be resolved, which is not available. gdb/ChangeLog: * dwarf2/expr.c (ensure_have_per_cu): New function. (dwarf_expr_context::dwarf_expr_context): Add compilation unit context information. (dwarf_expr_context::get_base_type): Move from dwarf_evaluate_loc_desc. (dwarf_expr_context::get_addr_index): Remove method. (dwarf_expr_context::dwarf_variable_value): Remove method. (dwarf_expr_context::execute_stack_op): Call compilation unit context info check. Inline get_addr_index and dwarf_variable_value methods. * dwarf2/expr.h (struct dwarf_expr_context): Add compilation context info. Remove get_addr_index and dwarf_variable_value. * dwarf2/frame.c (dwarf_expr_executor::get_addr_index): Remove method. (dwarf_expr_executor::dwarf_variable_value): Remove method. * dwarf2/loc.c (sect_variable_value): Expose function. (dwarf_evaluate_loc_desc::get_addr_index): Remove method. (dwarf_evaluate_loc_desc::dwarf_variable_value): Remove method. (class dwarf_evaluate_loc_desc): Move compilation unit context information to dwarf_expr_context class. * dwarf2/loc.h (sect_variable_value): Expose function. --- gdb/dwarf2/expr.c | 54 ++++++++++++++++++++++++++++++++++++++-------- gdb/dwarf2/expr.h | 26 ++++++++-------------- gdb/dwarf2/frame.c | 10 --------- gdb/dwarf2/loc.c | 35 +++--------------------------- gdb/dwarf2/loc.h | 8 +++++++ 5 files changed, 65 insertions(+), 68 deletions(-) diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index 6ba8b90c58..29f5f977ac 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -68,6 +68,16 @@ ensure_have_frame (struct frame_info *frame, const char *op_name) _("%s evaluation requires a frame."), op_name); } +/* Ensure that a PER_CU is defined and throw an exception otherwise. */ + +static void +ensure_have_per_cu (struct dwarf2_per_cu_data *per_cu, const char* op_name) +{ + if (per_cu == nullptr) + throw_error (GENERIC_ERROR, + _("%s evaluation requires a compilation unit."), op_name); +} + /* See expr.h. */ CORE_ADDR @@ -123,7 +133,8 @@ dwarf_expr_context::dwarf_expr_context (dwarf2_per_objfile *per_objfile) data (NULL), initialized (0), per_objfile (per_objfile), - frame (nullptr) + frame (nullptr), + per_cu (nullptr) { } @@ -207,6 +218,25 @@ dwarf_expr_context::get_frame_base (const gdb_byte **start, start, length); } +/* See expr.h. */ + +struct type * +dwarf_expr_context::get_base_type (cu_offset die_cu_off, int size) +{ + if (per_cu == nullptr) + return builtin_type (this->gdbarch)->builtin_int; + + struct type *result = dwarf2_get_die_type (die_cu_off, per_cu, per_objfile); + + if (result == NULL) + error (_("Could not find type for DW_OP_const_type")); + + if (size != 0 && TYPE_LENGTH (result) != size) + error (_("DW_OP_const_type has different sizes for type and data")); + + return result; +} + /* Require that TYPE be an integral type; throw an exception if not. */ static void @@ -703,14 +733,20 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, case DW_OP_addrx: case DW_OP_GNU_addr_index: + ensure_have_per_cu (this->per_cu, "DW_OP_addrx"); + op_ptr = safe_read_uleb128 (op_ptr, op_end, &uoffset); - result = this->get_addr_index (uoffset); + result = dwarf2_read_addr_index (this->per_cu, this->per_objfile, + uoffset); result += this->per_objfile->objfile->text_section_offset (); result_val = value_from_ulongest (address_type, result); break; case DW_OP_GNU_const_index: + ensure_have_per_cu (per_cu, "DW_OP_GNU_const_index"); + op_ptr = safe_read_uleb128 (op_ptr, op_end, &uoffset); - result = this->get_addr_index (uoffset); + result = dwarf2_read_addr_index (this->per_cu, this->per_objfile, + uoffset); result_val = value_from_ulongest (address_type, result); break; @@ -840,10 +876,7 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, case DW_OP_GNU_implicit_pointer: { int64_t len; - - if (this->ref_addr_size == -1) - error (_("DWARF-2 expression error: DW_OP_implicit_pointer " - "is not allowed in frame context")); + ensure_have_per_cu (per_cu, "DW_OP_implicit_pointer"); /* The referred-to DIE of sect_offset kind. */ this->len = extract_unsigned_integer (op_ptr, this->ref_addr_size, @@ -1336,13 +1369,16 @@ dwarf_expr_context::execute_stack_op (const gdb_byte *op_ptr, case DW_OP_GNU_variable_value: { + ensure_have_per_cu (per_cu, "DW_OP_GNU_variable_value"); + sect_offset sect_off = (sect_offset) extract_unsigned_integer (op_ptr, this->ref_addr_size, byte_order); op_ptr += this->ref_addr_size; - result_val = value_cast (address_type, - this->dwarf_variable_value (sect_off)); + result_val = sect_variable_value (sect_off, this->per_cu, + this->per_objfile); + result_val = value_cast (address_type, result_val); } break; diff --git a/gdb/dwarf2/expr.h b/gdb/dwarf2/expr.h index 5abb870f88..e17cd99c25 100644 --- a/gdb/dwarf2/expr.h +++ b/gdb/dwarf2/expr.h @@ -189,6 +189,9 @@ struct dwarf_expr_context /* Frame information used for the evaluation. */ struct frame_info *frame; + /* Compilation unit used for the evaluation. */ + struct dwarf2_per_cu_data *per_cu; + /* Read LENGTH bytes at ADDR into BUF. */ virtual void read_mem (gdb_byte *buf, CORE_ADDR addr, size_t length) = 0; @@ -208,19 +211,6 @@ struct dwarf_expr_context subroutine. */ virtual void dwarf_call (cu_offset die_cu_off) = 0; - /* Execute "variable value" operation on the DIE at SECT_OFF. */ - virtual struct value *dwarf_variable_value (sect_offset sect_off) = 0; - - /* Return the base type given by the indicated DIE at DIE_CU_OFF. - This can throw an exception if the DIE is invalid or does not - represent a base type. SIZE is non-zero if this function should - verify that the resulting type has the correct size. */ - virtual struct type *get_base_type (cu_offset die_cu_off, int size) - { - /* Anything will do. */ - return builtin_type (this->gdbarch)->builtin_int; - } - /* Push on DWARF stack an entry evaluated for DW_TAG_call_site's parameter matching KIND and KIND_U at the caller of specified BATON. If DEREF_SIZE is not -1 then use DW_AT_call_data_value instead of @@ -229,10 +219,6 @@ struct dwarf_expr_context union call_site_parameter_u kind_u, int deref_size) = 0; - /* Return the address indexed by DW_OP_addrx or DW_OP_GNU_addr_index. - This can throw an exception if the index is out of range. */ - virtual CORE_ADDR get_addr_index (unsigned int index) = 0; - /* Return the `object address' for DW_OP_push_object_address. */ virtual CORE_ADDR get_object_address () = 0; @@ -255,6 +241,12 @@ struct dwarf_expr_context START and LENGTH. The result must be live until the current expression evaluation is complete. */ void get_frame_base (const gdb_byte **start, size_t *length); + + /* Return the base type given by the indicated DIE at DIE_CU_OFF. + This can throw an exception if the DIE is invalid or does not + represent a base type. SIZE is non-zero if this function should + verify that the resulting type has the correct size. */ + struct type *get_base_type (cu_offset die_cu_off, int size); }; /* Return the value of register number REG (a DWARF register number), diff --git a/gdb/dwarf2/frame.c b/gdb/dwarf2/frame.c index 4cc0ffe3c5..c93ec5d5a6 100644 --- a/gdb/dwarf2/frame.c +++ b/gdb/dwarf2/frame.c @@ -258,16 +258,6 @@ class dwarf_expr_executor : public dwarf_expr_context invalid ("DW_OP_call*"); } - struct value *dwarf_variable_value (sect_offset sect_off) override - { - invalid ("DW_OP_GNU_variable_value"); - } - - CORE_ADDR get_addr_index (unsigned int index) override - { - invalid ("DW_OP_addrx or DW_OP_GNU_addr_index"); - } - private: void invalid (const char *op) ATTRIBUTE_NORETURN diff --git a/gdb/dwarf2/loc.c b/gdb/dwarf2/loc.c index ecf1020b3b..21e43e399c 100644 --- a/gdb/dwarf2/loc.c +++ b/gdb/dwarf2/loc.c @@ -620,12 +620,10 @@ per_cu_dwarf_call (struct dwarf_expr_context *ctx, cu_offset die_offset, ctx->eval (block.data, block.size); } -/* Given context CTX, section offset SECT_OFF, and compilation unit - data PER_CU, execute the "variable value" operation on the DIE - found at SECT_OFF. */ +/* See loc.h. */ -static struct value * -sect_variable_value (struct dwarf_expr_context *ctx, sect_offset sect_off, +struct value * +sect_variable_value (sect_offset sect_off, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile) { @@ -654,7 +652,6 @@ class dwarf_evaluate_loc_desc : public dwarf_expr_context : dwarf_expr_context (per_objfile) {} - struct dwarf2_per_cu_data *per_cu; CORE_ADDR obj_address; /* Helper function for dwarf2_evaluate_loc_desc. Computes the PC for @@ -680,32 +677,6 @@ class dwarf_evaluate_loc_desc : public dwarf_expr_context per_cu_dwarf_call (this, die_offset, per_cu, per_objfile); } - /* Helper interface of sect_variable_value for - dwarf2_evaluate_loc_desc. */ - - struct value *dwarf_variable_value (sect_offset sect_off) override - { - return sect_variable_value (this, sect_off, per_cu, per_objfile); - } - - struct type *get_base_type (cu_offset die_offset, int size) override - { - struct type *result = dwarf2_get_die_type (die_offset, per_cu, per_objfile); - if (result == NULL) - error (_("Could not find type for DW_OP_const_type")); - if (size != 0 && TYPE_LENGTH (result) != size) - error (_("DW_OP_const_type has different sizes for type and data")); - return result; - } - - /* Callback function for dwarf2_evaluate_loc_desc. - Fetch the address indexed by DW_OP_addrx or DW_OP_GNU_addr_index. */ - - CORE_ADDR get_addr_index (unsigned int index) override - { - return dwarf2_read_addr_index (per_cu, per_objfile, index); - } - /* Callback function for get_object_address. Return the address of the VLA object. */ diff --git a/gdb/dwarf2/loc.h b/gdb/dwarf2/loc.h index 907455b72c..85700ea99d 100644 --- a/gdb/dwarf2/loc.h +++ b/gdb/dwarf2/loc.h @@ -53,6 +53,14 @@ extern void func_get_frame_base_dwarf_block (struct symbol *framefunc, const gdb_byte **start, size_t *length); +/* Given section offset SECT_OFF, and compilation unit data + PER_CU, execute the "variable value" operation on the DIE + found at SECT_OFF. */ + +struct value *sect_variable_value (sect_offset sect_off, + dwarf2_per_cu_data *per_cu, + dwarf2_per_objfile *per_objfile); + /* Evaluate a location description, starting at DATA and with length SIZE, to find the current location of variable of TYPE in the context of FRAME. */ -- 2.17.1