]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/llvm/tools/lldb/source/Host/common/DynamicLibrary.cpp
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / llvm / tools / lldb / source / Host / common / DynamicLibrary.cpp
1 //===-- DynamicLibrary.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 "lldb/Core/Error.h"
11 #include "lldb/Host/DynamicLibrary.h"
12
13 using namespace lldb_private;
14
15 DynamicLibrary::DynamicLibrary (const FileSpec& spec, uint32_t options) : m_filespec(spec)
16 {
17     Error err;
18     m_handle = Host::DynamicLibraryOpen (spec,options,err);
19     if (err.Fail())
20         m_handle = NULL;
21 }
22
23 bool
24 DynamicLibrary::IsValid ()
25 {
26     return m_handle != NULL;
27 }
28
29 DynamicLibrary::~DynamicLibrary ()
30 {
31     if (m_handle)
32         Host::DynamicLibraryClose (m_handle);
33 }