From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2056.outbound.protection.outlook.com [40.107.244.56]) by sourceware.org (Postfix) with ESMTPS id 237ED393D02B for ; Mon, 7 Dec 2020 19:01:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 237ED393D02B ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ElZiWWTh2yEWlI8F0usaeXxOdsKtK4oixPo5r85THCp4omGNYS1TLx/BQ0+94HeCbmY3elXQQgSYRSUa4qTDTsd74zPtwN53Lx6pYLXl0Jb3Jns6ilhKWJTBg/iJdNTOaiw//sm7c5fOzFNGvadRzUysc4XQfxOsstarCxQ/4zPKppkvwtVuHJjLyhBMrrU1CWZaBKRYQ9IxklBpC2RtDeosuBPhcjMadRO5WGAT2/kfiGjhN32ez+tKLXuBYrTln7UXsY9IjMSitdvzAcMuvcvOZhrQ4ShrSqmkigx2yAPEvCaYiC4zZB7yi/dnAiIrn5pLl1H5zKNM9hq/KA4COg== 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=WUr7ppgdO7jcjwfFTvrhkTSUTm1Uytz+Bp2XEEWnuHI=; b=KwaM8//o1SH8JWbJ4xmxrWthPnm+5wC0YntRnrSZYOq7+7BWGMz7lJXmcxbfbD5mHnQ4NPGRzj/Gbbd/oQrmYhyc6GhdjNXE7ltW3WVbq0+qWNpEW9j64wj0Wpe6RK14eT12rwys5IpcxECfDvRqWBdWa7PQYu9OWQ7psPyU0IllPDRKdHW2FqABJlEG2qIpetyImd3679kQqZjBxrngv6/THJUOQE7xe2sa3smqybgrtrZ7BjJnyfvHV6TbgGOCLp6+tmDkSxz0ACJ+TYT0XFhp7COG63nrS0IPtgagclf5nCxu8Ye4Go/vs4luv92orrQMo72WDW8acDaI6ZjMRQ== 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:01:19 +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:01:19 +0000 From: Zoran Zaric To: gdb-patches@sourceware.org Cc: Zoran Zaric Subject: [PATCH 18/30] Add new classes that model DWARF stack element Date: Mon, 7 Dec 2020 19:00:19 +0000 Message-Id: <20201207190031.13341-19-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; charset=UTF-8 Content-Transfer-Encoding: 8bit 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:01:18 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: ef638d12-abb3-472e-7bfb-08d89ae27b2e X-MS-TrafficTypeDiagnostic: DM6PR12MB4561: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lLQmLe5KkmFm/0ugaQByNzeCkArs7DNZ0O1EdoqkYsITtdQLWys6z0c5zJsRT5+bq9T42q/AA8LQ5HSB7o3VM36TNjjzyk9oGBUXEC6C0JHyg7isUjKbn3DYvig/Jk2ukTlDO7d2QZPejr7rrby0Ah1pHqm3svj6A5Gn2evwyrLz9O93l7DI4rT31byWZCBrANPDcLX0LldqODxX1Zi9fHTJZ4CjlnmEycpFTPRDq4m2NYZKM9iYIxJzXqYnXSTkWeOBNXZbIqZW7/hG2AyE7Mg7t1p44Nsq1jiVtlO5lCbh+4eL+SO7RG/PYOB1joRPDGCPF4Kduo2uFWi2yJ3E5K2AgHGtq6NjjHxFKrEd89xJ3t0wOhj7weFGj7QdqgXgHpucFiq/8YdPVM4C4sznCg== 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)(52116002)(36756003)(2906002)(6512007)(8676002)(966005)(6486002)(16526019)(2616005)(66946007)(66476007)(66556008)(6916009)(5660300002)(186003)(8936002)(478600001)(316002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?UU5FOXNzTy9mOXk0NDJDZnh0akRJL3BFbGhVeUZYd3R5T1NKMytubVR1d2tZ?= =?utf-8?B?bjNwQWowUlBwZnRLU0FscE9SSEhkQmdyTFk1Q0lDVjR1ZWJKdHJEU3BGY1Jv?= =?utf-8?B?NjhhL2d6UXVicmRkL3FYT3k3aGZscktBQ29wMTB4M0kzL1lHcS9VSmNzV0Y2?= =?utf-8?B?M3RmUFpMU051cUNyNDFPcG5UK3dnNXFUQloxTTNGMlErNTdMKzArTEhCc1RC?= =?utf-8?B?NklVN284VTdneU1YTVUzalYvWnVMbTkvWS9GaVhlSEVnbGllTmk2SlF1eitj?= =?utf-8?B?azErdDNLK1dsdllpdXp6dDZjTW1NWjZpcEpmYk5MTml0ZDV5SGF2aWg5VFRj?= =?utf-8?B?YVBhallhcWxBNllETzJpRnlzTTBvbE85TmhGUEJ5RkFwb3d5dEExUUMwaVhY?= =?utf-8?B?NmFjOC9yRHZic0s5anFvL1JqZ09ZV1FLRlcwdUdzRjBnY1VrcWpjVWZpNGNQ?= =?utf-8?B?UW1VMHVpMGhqNTFqRFVTUGRVRGhhRmZSQnZWWmlBUkJaaEY5aUcvUzRuNXpE?= =?utf-8?B?TTRTV25lYXBRUURnYm42NE5oQ05CZGZ2Ykt6L0lTTE1KNkhhSzF1aXUwM1Ra?= =?utf-8?B?aEZFTkl1ZEsrRDhYZFdQQ0lTNm54Y1pDZ0M4THdObWJ5ZDJvRVh5LzU3U1ZC?= =?utf-8?B?Y0dlcmEwR2J6RTcxU3NuZjFUelBKRHltbG9OQkVMRDBXRUNSTS95S2lQcVFa?= =?utf-8?B?Q2d0SCt6ZEplWHBzTHNrVDJhS2VEY0paaUhkYXBDenpGT2h5UjRvNGkxK3p4?= =?utf-8?B?VkIrdU5GRWthVTJnbmxTcWJLLzg5OU8wcEVOejAzeXNBdkRMeCtQdXN3dURR?= =?utf-8?B?U2Y4RkVCK3NNd3llUVJsNXhKeFQyZXUxMzBZdzVDZzdVaTAyL0MyV2pKYjlZ?= =?utf-8?B?Uk5hOU4wc0xnQ3FoVm84SjhIZ1BpMXBVUGVSRHExdU9kRzBtT0JoWjAraW50?= =?utf-8?B?VTVJdW5XbTc0NFZWOXZiVmhGQ0d0dDA3aWYraUlTMmNON0dCU3RVV1dLNFJ3?= =?utf-8?B?MlBOWHpOQlF5cWViM0JTK1p2a25WMEs1NUl6NU1jeWFqdHR1VVB3VlZWaWIx?= =?utf-8?B?NnIwU2s1Vzc5d2R6dHViWjR2ZGF5MER1a3NtWEdzOGcxUlZldVVLNjBabWJq?= =?utf-8?B?c0RPWTZvVEJzcmVXNHJVaWhKTmtxcldlQm1LT0V4ZThaMFY4d1BqOElwYWlL?= =?utf-8?B?WnI5MFlOTW5kNUZhN25DeTRxTnR5ZEZrY2tWbTRFTkdGUVpyNzNCR1RJWTVQ?= =?utf-8?B?a25OQ2dxY0NyWHJHYkVzTDJVUGk3Wk9RazlFdHlwT0s4clU4bElURDc2QWc2?= =?utf-8?B?OGowSURwNjFheUF3djdVdEZISVkyRmM0TEJUb1ZCYWhxYThhR2QxaVRoTnc0?= =?utf-8?B?TXVzUTFGaUxtWDMxcm9SeXIvNEd1SXplV0tSdno5VHEzd2E4OVE3T3k1TEUr?= =?utf-8?Q?drdQUKvD?= 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:01:19.1896 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-Network-Message-Id: ef638d12-abb3-472e-7bfb-08d89ae27b2e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fOBrJf1XF/rWRsurCnV6mqFGIDfh6YgpT2aeaLTuxJ4N627NrftbQ7Ke44LNoRYm7IZz0b4q9cPsXyUItgxoFA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4561 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Mon, 07 Dec 2020 19:01:33 -0000 The rest of the patch series addresses the issues described in a "Motivation" section of the AMD’s DWARF standard extensions that can be found at: https://llvm.org/docs/AMDGPUDwarfExtensionsForHeterogeneousDebugging.html The document describes a couple of main issues found when using the current DWARF 5 version to describe optimized code for SIMD and SIMT architectures. Without going much into details described in the document, the main point is that DWARF version 5 does not allow a proper support for address spaces and it does not allow a location description to be part of a DWARF expression, unless it is a leaf node of that expression. Both issues can be solved in a clean way by introducing a new set of classes that describe all entry types which can be placed on a DWARF stack, while keeping a full backward compatibility with the previous standard version. These entry types can now be either a typed value or any location description. Currently, the result of an expression evaluation is kept in a separate data structure, while with the new approach, it will be always found as a top element of the DWARF stack. The reason why this approach is backward compatible is because in version 5, a location description is only allowed to be a leaf node of the expression or a composite piece. Question here is, why do we need a new set of classes and why not just use the struct value instead? As it stands, there are couple of issues with using the struct value to describe a DWARF stack element: - It is not designed to represent a DWARF location description specifically, instead it behaves more like unified debug information format that represents an actual target resource. One example of this is accessing data of a struct value register location description, where if the amount of data accessed is larger then the register, results in accessing more then one register. In DWARF this is not a valid behavior and locations that span more then one register should be described as a composite location description. - There is a tight coupling between struct value and it’s type information, regardless if the data represented is describing a value (not_lval) or a location description. While the type information dictates how the data is accessed for a struct value case, in DWARF, location description doesn’t have a type so data access is not bound by it. - DWARF values only support much simpler base types, while struct value can be linked to any type. Admittedly, new classes are still using the same struct value infrastructure for a value based operations at the moment, but that is planned to change in the near future. - struct value register location description requires a frame id information which makes them unsuitable for CFA expression evaluation. So, there seems to be a lack of separation of concerns in the design of a struct value infrastructure, while the new classes are handling one specific purpose and are completely encapsulated in the expr.c. Additional benefit of this design is that it makes a step in a right direction for being able to evaluate DWARF expressions on a gdbserver side in the near future, which sounds like a desirable thing. It is also worth mentioning that this new location description representation is based on a bit granularity (the bit_suboffset class member) even though the DWARF standard has a very limited support for it (mostly used for DW_OP_bit_piece operation). By allowing any location description to define a bit sub-offset of the location, we are able to give more options for supporting of new concepts (like the existing packed arrays in Ada language). In this patch, a new set of classes that describe a DWARF stack element are added. The new classes are: - Value - describes a numerical value with a DWARF base type. - Location description - describes a DWARF location description. - Undefined location - describes a location that is not defined. - Memory location - describes a location in memory. - Register location - describes a register location in a frame context. - Implicit location - describes a location that implicitly holds a value that it describes. - Implicit pointer - describes a concept of an implicit pointer to a source variable. - Composite location - describes a location that is composed from pieces of other location descriptions. For now, these classes are just defined, and they are planned to be used by the following patches. gdb/ChangeLog: * dwarf2/expr.c (class dwarf_entry): New class. (class dwarf_value): New class. (class dwarf_location): New class. (class dwarf_undefined): New class. (class dwarf_memory): New class. (class dwarf_register): New class. (class dwarf_implicit): New class. (class dwarf_implicit_pointer): New class. (class dwarf_composite): New class. * value.c (pack_unsigned_long): Expose function. * value.h (pack_unsigned_long): Expose function. --- gdb/dwarf2/expr.c | 346 ++++++++++++++++++++++++++++++++++++++++++++++ gdb/value.c | 2 +- gdb/value.h | 2 + 3 files changed, 349 insertions(+), 1 deletion(-) diff --git a/gdb/dwarf2/expr.c b/gdb/dwarf2/expr.c index 0c9ea51e5b..c0bb06fc4c 100644 --- a/gdb/dwarf2/expr.c +++ b/gdb/dwarf2/expr.c @@ -267,6 +267,352 @@ write_to_memory (CORE_ADDR address, const gdb_byte *buffer, length, buffer); } +/* Base class that describes entries found on a DWARF expression + evaluation stack. */ + +class dwarf_entry : public refcounted_object +{ +public: + /* Not expected to be called on it's own. */ + dwarf_entry () = default; + + virtual ~dwarf_entry () = 0; +}; + +dwarf_entry::~dwarf_entry () = default; + +/* Value entry found on a DWARF expression evaluation stack. */ + +class dwarf_value : public dwarf_entry +{ +public: + dwarf_value (const gdb_byte* contents, struct type *type) + { + size_t type_len = TYPE_LENGTH (type); + m_contents.reset ((gdb_byte *) xzalloc (type_len)); + + memcpy (m_contents.get (), contents, type_len); + m_type = type; + } + + dwarf_value (ULONGEST value, struct type *type) + { + m_contents.reset ((gdb_byte *) xzalloc (TYPE_LENGTH (type))); + + pack_unsigned_long (m_contents.get (), type, value); + m_type = type; + } + + dwarf_value (LONGEST value, struct type *type) + { + m_contents.reset ((gdb_byte *) xzalloc (TYPE_LENGTH (type))); + + pack_long (m_contents.get (), type, value); + m_type = type; + } + + virtual ~dwarf_value () = default; + + const gdb_byte* get_contents () const + { + return m_contents.get (); + } + + struct type* get_type () const + { + return m_type; + } + + LONGEST to_long () const + { + return unpack_long (m_type, m_contents.get ()); + } + +private: + /* Value contents as a stream of bytes in target byte order. */ + gdb::unique_xmalloc_ptr m_contents; + + /* Type of the value held by the entry. */ + struct type *m_type; +}; + +/* Location description entry found on a DWARF expression evaluation stack. + + Types of locations descirbed can be: register location, memory location, + implicit location, implicit pointer location, undefined location and + composite location (made out of any of the location types including + another composite location). */ + +class dwarf_location : public dwarf_entry +{ +public: + /* Not expected to be called on it's own. */ + dwarf_location (LONGEST offset = 0, LONGEST bit_suboffset = 0) + : m_initialised (true) + { + m_offset = offset; + m_offset += bit_suboffset / HOST_CHAR_BIT; + m_bit_suboffset = bit_suboffset % HOST_CHAR_BIT; + } + + virtual ~dwarf_location () = default; + + LONGEST get_offset () const + { + return m_offset; + }; + + LONGEST get_bit_suboffset () const + { + return m_bit_suboffset; + }; + + void add_bit_offset (LONGEST bit_offset) + { + LONGEST bit_total_offset = m_bit_suboffset + bit_offset; + + m_offset += bit_total_offset / HOST_CHAR_BIT; + m_bit_suboffset = bit_total_offset % HOST_CHAR_BIT; + }; + + void set_initialised (bool initialised) + { + m_initialised = initialised; + }; + + bool is_initialised () const + { + return m_initialised; + }; + +private: + /* Byte offset into the location. */ + LONGEST m_offset; + + /* Bit suboffset of the last byte. */ + LONGEST m_bit_suboffset; + + /* Whether the location is initialized. Used for non-standard + DW_OP_GNU_uninit operation. */ + bool m_initialised; +}; + +/* Undefined location description entry. This is a special location + description type that describes the location description that is + not known. */ + +class dwarf_undefined : public dwarf_location +{ +public: + dwarf_undefined (LONGEST offset = 0, LONGEST bit_suboffset = 0) + : dwarf_location (offset, bit_suboffset) + {} +}; + +class dwarf_memory : public dwarf_location +{ +public: + dwarf_memory (LONGEST offset, LONGEST bit_suboffset = 0, + bool stack = false) + : dwarf_location (offset, bit_suboffset), + m_stack (stack) + {} + + bool in_stack () const + { + return m_stack; + }; + + void set_stack (bool stack) + { + m_stack = stack; + }; +private: + /* True if the location belongs to a stack memory region. */ + bool m_stack; +}; + +/* Register location description entry. */ + +class dwarf_register : public dwarf_location +{ +public: + dwarf_register (unsigned int regnum, + LONGEST offset = 0, LONGEST bit_suboffset = 0) + : dwarf_location (offset, bit_suboffset), + m_regnum (regnum) + {} + + unsigned int get_regnum () const + { + return m_regnum; + }; + +private: + /* DWARF register number. */ + unsigned int m_regnum; +}; + +/* Implicit location description entry. Describes a location + description not found on the target but instead saved in a + gdb-allocated buffer. */ + +class dwarf_implicit : public dwarf_location +{ +public: + + dwarf_implicit (const gdb_byte* contents, size_t size, + enum bfd_endian byte_order) + { + m_contents.reset ((gdb_byte *) xzalloc (size)); + + memcpy (m_contents.get (), contents, size); + m_size = size; + m_byte_order = byte_order; + } + + const gdb_byte* get_contents () const + { + return m_contents.get (); + } + + size_t get_size () const + { + return m_size; + } + + size_t get_byte_order () const + { + return m_byte_order; + } + +private: + /* Implicit location contents as a stream of bytes in target byte-order. */ + gdb::unique_xmalloc_ptr m_contents; + + /* Contents byte stream size. */ + size_t m_size; + + /* Contents original byte order. */ + enum bfd_endian m_byte_order; +}; + +/* Implicit pointer location description entry. */ + +class dwarf_implicit_pointer : public dwarf_location +{ +public: + dwarf_implicit_pointer (dwarf2_per_objfile *per_objfile, + struct dwarf2_per_cu_data *per_cu, + int addr_size, sect_offset die_offset, + LONGEST offset, LONGEST bit_suboffset = 0) + : dwarf_location (offset, bit_suboffset), + m_per_objfile (per_objfile), m_per_cu (per_cu), + m_addr_size (addr_size), m_die_offset (die_offset) + {} + + dwarf2_per_objfile *get_per_objfile () const + { + return m_per_objfile; + } + + dwarf2_per_cu_data *get_per_cu () const + { + return m_per_cu; + } + + int get_addr_size () const + { + return m_addr_size; + } + + sect_offset get_die_offset () const + { + return m_die_offset; + } + +private: + /* Per object file data of the implicit pointer. */ + dwarf2_per_objfile *m_per_objfile; + + /* Compilation unit context of the implicit pointer. */ + struct dwarf2_per_cu_data *m_per_cu; + + /* Address size for the evaluation. */ + int m_addr_size; + + /* DWARF die offset pointed by the implicit pointer. */ + sect_offset m_die_offset; +}; + +/* Composite location description entry. */ + +class dwarf_composite : public dwarf_location +{ +public: + dwarf_composite (LONGEST offset = 0, LONGEST bit_suboffset = 0) + : dwarf_location (offset, bit_suboffset) + {} + + /* A composite location gets detached from its factory object for + the purpose of lval_computed resolution, which means that it + needs to take care of garbage collecting its pieces. */ + ~dwarf_composite () override + { + for (unsigned int i = 0; i < m_pieces.size (); i++) + { + dwarf_location* location = m_pieces[i].m_location; + + location->decref (); + + if (location->refcount () == 0) + delete location; + } + } + + void add_piece (dwarf_location* location, ULONGEST bit_size) + { + gdb_assert (location != nullptr); + location->incref (); + m_pieces.emplace_back (location, bit_size); + } + + const dwarf_location* get_piece_at (unsigned int index) const + { + gdb_assert (index < m_pieces.size ()); + return m_pieces[index].m_location; + } + + ULONGEST get_bit_size_at (unsigned int index) const + { + gdb_assert (index < m_pieces.size ()); + return m_pieces[index].m_size; + } + + size_t get_pieces_num () const + { + return m_pieces.size (); + } + +private: + /* Composite piece that contains a piece location + description and it's size. */ + class piece + { + public: + piece (dwarf_location *location, ULONGEST size) + : m_location (location), + m_size (size) + {} + + dwarf_location *m_location; + ULONGEST m_size; + }; + + /* Vector of composite pieces. */ + std::vector m_pieces; +}; + struct piece_closure { /* Reference count. */ diff --git a/gdb/value.c b/gdb/value.c index eba5bce6d2..5f52c2d566 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -3401,7 +3401,7 @@ pack_long (gdb_byte *buf, struct type *type, LONGEST num) /* Pack NUM into BUF using a target format of TYPE. */ -static void +void pack_unsigned_long (gdb_byte *buf, struct type *type, ULONGEST num) { LONGEST len; diff --git a/gdb/value.h b/gdb/value.h index d026c8ed95..2eaba57487 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -677,6 +677,8 @@ extern struct value *value_field_bitfield (struct type *type, int fieldno, const struct value *val); extern void pack_long (gdb_byte *buf, struct type *type, LONGEST num); +extern void pack_unsigned_long (gdb_byte *buf, struct type *type, + ULONGEST num); extern struct value *value_from_longest (struct type *type, LONGEST num); extern struct value *value_from_ulongest (struct type *type, ULONGEST num); -- 2.17.1