mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-28 14:26:08 +00:00

it logs the function calls, their arguments and the return values. This is not complete or polished, but I am committing it now, at the request of someone who really wants to use it, even though it's not really done. It currently does not attempt to log all the functions, just the most important ones. I will be making further adjustments to the API logging code over the next few days/weeks. (Suggestions for improvements are welcome). Update the Python build scripts to re-build the swig C++ file whenever the python-extensions.swig file is modified. Correct the help for 'log enable' command (give it the correct number & type of arguments). llvm-svn: 117349
73 lines
1.7 KiB
C++
73 lines
1.7 KiB
C++
//===-- SBHostOS.cpp --------------------------------------------*- C++ -*-===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "lldb/API/SBHostOS.h"
|
|
#include "lldb/API/SBError.h"
|
|
#include "lldb/Core/FileSpec.h"
|
|
#include "lldb/Core/Log.h"
|
|
#include "lldb/Host/Host.h"
|
|
|
|
using namespace lldb;
|
|
using namespace lldb_private;
|
|
|
|
|
|
|
|
SBFileSpec
|
|
SBHostOS::GetProgramFileSpec ()
|
|
{
|
|
SBFileSpec sb_filespec;
|
|
sb_filespec.SetFileSpec (Host::GetProgramFileSpec ());
|
|
return sb_filespec;
|
|
}
|
|
|
|
lldb::thread_t
|
|
SBHostOS::ThreadCreate
|
|
(
|
|
const char *name,
|
|
void *(*thread_function)(void *),
|
|
void *thread_arg,
|
|
SBError *error_ptr
|
|
)
|
|
{
|
|
Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
|
|
|
|
if (log)
|
|
log->Printf ("SBHostOS::ThreadCreate (%s, %p, %p, error_ptr)", name, thread_function, thread_arg);
|
|
|
|
// CAROLINE: FIXME: You need to log a return value?
|
|
|
|
return Host::ThreadCreate (name, thread_function, thread_arg, error_ptr ? error_ptr->get() : NULL);
|
|
}
|
|
|
|
void
|
|
SBHostOS::ThreadCreated (const char *name)
|
|
{
|
|
Host::ThreadCreated (name);
|
|
}
|
|
|
|
bool
|
|
SBHostOS::ThreadCancel (lldb::thread_t thread, SBError *error_ptr)
|
|
{
|
|
return Host::ThreadCancel (thread, error_ptr ? error_ptr->get() : NULL);
|
|
}
|
|
|
|
bool
|
|
SBHostOS::ThreadDetach (lldb::thread_t thread, SBError *error_ptr)
|
|
{
|
|
return Host::ThreadDetach (thread, error_ptr ? error_ptr->get() : NULL);
|
|
}
|
|
|
|
bool
|
|
SBHostOS::ThreadJoin (lldb::thread_t thread, void **result, SBError *error_ptr)
|
|
{
|
|
return Host::ThreadJoin (thread, result, error_ptr ? error_ptr->get() : NULL);
|
|
}
|
|
|
|
|