]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - contrib/llvm/tools/lldb/source/Plugins/SymbolFile/DWARF/DWARFDataExtractor.cpp
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / contrib / llvm / tools / lldb / source / Plugins / SymbolFile / DWARF / DWARFDataExtractor.cpp
1 //===-- DWARFDataExtractor.cpp ----------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "DWARFDataExtractor.h"
11
12 namespace lldb_private {
13
14 uint64_t
15 DWARFDataExtractor::GetDWARFInitialLength(lldb::offset_t *offset_ptr) const
16 {
17     uint64_t length = GetU32(offset_ptr);
18     m_is_dwarf64 = (length == UINT32_MAX);
19     if (m_is_dwarf64)
20         length = GetU64(offset_ptr);
21     return length;
22 }
23
24 dw_offset_t
25 DWARFDataExtractor::GetDWARFOffset(lldb::offset_t *offset_ptr) const
26 {
27     return GetMaxU64(offset_ptr, m_is_dwarf64 ? 8 : 4);
28 }
29
30 }