Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- SBHostOS.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/API/SBHostOS.h" |
| 11 | #include "lldb/API/SBError.h" |
| 12 | #include "lldb/Core/FileSpec.h" |
| 13 | #include "lldb/Host/Host.h" |
| 14 | |
| 15 | using namespace lldb; |
| 16 | using namespace lldb_private; |
| 17 | |
| 18 | |
| 19 | |
| 20 | SBFileSpec |
| 21 | SBHostOS::GetProgramFileSpec () |
| 22 | { |
| 23 | SBFileSpec sb_filespec; |
| 24 | sb_filespec.SetFileSpec (Host::GetProgramFileSpec ()); |
| 25 | return sb_filespec; |
| 26 | } |
| 27 | |
| 28 | lldb::thread_t |
| 29 | SBHostOS::ThreadCreate |
| 30 | ( |
| 31 | const char *name, |
| 32 | void *(*thread_function)(void *), |
| 33 | void *thread_arg, |
| 34 | SBError *error_ptr |
| 35 | ) |
| 36 | { |
| 37 | return Host::ThreadCreate (name, thread_function, thread_arg, error_ptr ? error_ptr->get() : NULL); |
| 38 | } |
| 39 | |
| 40 | void |
| 41 | SBHostOS::ThreadCreated (const char *name) |
| 42 | { |
| 43 | Host::ThreadCreated (name); |
| 44 | } |
| 45 | |
| 46 | bool |
| 47 | SBHostOS::ThreadCancel (lldb::thread_t thread, SBError *error_ptr) |
| 48 | { |
| 49 | return Host::ThreadCancel (thread, error_ptr ? error_ptr->get() : NULL); |
| 50 | } |
| 51 | |
| 52 | bool |
| 53 | SBHostOS::ThreadDetach (lldb::thread_t thread, SBError *error_ptr) |
| 54 | { |
| 55 | return Host::ThreadDetach (thread, error_ptr ? error_ptr->get() : NULL); |
| 56 | } |
| 57 | |
| 58 | bool |
| 59 | SBHostOS::ThreadJoin (lldb::thread_t thread, void **result, SBError *error_ptr) |
| 60 | { |
| 61 | return Host::ThreadJoin (thread, result, error_ptr ? error_ptr->get() : NULL); |
| 62 | } |
| 63 | |
| 64 | |