diff options
author | Greg Clayton <gclayton@apple.com> | 2013-03-27 23:08:40 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2013-03-27 23:08:40 +0000 |
commit | 5160ce5c72e5f55c2e83ca9914cd0f02e0c5ceb3 (patch) | |
tree | b24bb5959b40d8f0e99ed6d8b13271270dbf08e3 /lldb/source/Core | |
parent | ccc266559f5c028442b6393362da14d866d9b32b (diff) | |
download | bcm5719-llvm-5160ce5c72e5f55c2e83ca9914cd0f02e0c5ceb3.tar.gz bcm5719-llvm-5160ce5c72e5f55c2e83ca9914cd0f02e0c5ceb3.zip |
<rdar://problem/13521159>
LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down.
All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down.
llvm-svn: 178191
Diffstat (limited to 'lldb/source/Core')
-rw-r--r-- | lldb/source/Core/AddressResolverFileLine.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Core/AddressResolverName.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Core/Broadcaster.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Core/Communication.cpp | 10 | ||||
-rw-r--r-- | lldb/source/Core/ConnectionFileDescriptor.cpp | 30 | ||||
-rw-r--r-- | lldb/source/Core/DataBufferMemoryMap.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Core/Debugger.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Core/Listener.cpp | 14 | ||||
-rw-r--r-- | lldb/source/Core/Log.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Core/Module.cpp | 6 | ||||
-rw-r--r-- | lldb/source/Core/ModuleList.cpp | 20 | ||||
-rw-r--r-- | lldb/source/Core/ValueObject.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Core/ValueObjectDynamicValue.cpp | 2 |
13 files changed, 59 insertions, 59 deletions
diff --git a/lldb/source/Core/AddressResolverFileLine.cpp b/lldb/source/Core/AddressResolverFileLine.cpp index 78f156d9556..f7004c8bb08 100644 --- a/lldb/source/Core/AddressResolverFileLine.cpp +++ b/lldb/source/Core/AddressResolverFileLine.cpp @@ -52,7 +52,7 @@ AddressResolverFileLine::SearchCallback uint32_t sc_list_size; CompileUnit *cu = context.comp_unit; - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS)); sc_list_size = cu->ResolveSymbolContext (m_file_spec, m_line_number, m_inlines, false, eSymbolContextEverything, sc_list); diff --git a/lldb/source/Core/AddressResolverName.cpp b/lldb/source/Core/AddressResolverName.cpp index 3e7c373998b..c8b9db896d9 100644 --- a/lldb/source/Core/AddressResolverName.cpp +++ b/lldb/source/Core/AddressResolverName.cpp @@ -37,7 +37,7 @@ AddressResolverName::AddressResolverName { if (!m_regex.Compile (m_func_name.AsCString())) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS)); if (log) log->Warning ("function name regexp: \"%s\" did not compile.", m_func_name.AsCString()); @@ -98,7 +98,7 @@ AddressResolverName::SearchCallback SymbolContext sc; Address func_addr; - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_BREAKPOINTS)); if (m_class_name) { diff --git a/lldb/source/Core/Broadcaster.cpp b/lldb/source/Core/Broadcaster.cpp index 584bf00d32f..5af7497c8da 100644 --- a/lldb/source/Core/Broadcaster.cpp +++ b/lldb/source/Core/Broadcaster.cpp @@ -29,7 +29,7 @@ Broadcaster::Broadcaster (BroadcasterManager *manager, const char *name) : m_hijacking_masks(), m_manager (manager) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) log->Printf ("%p Broadcaster::Broadcaster(\"%s\")", this, m_broadcaster_name.AsCString()); @@ -37,7 +37,7 @@ Broadcaster::Broadcaster (BroadcasterManager *manager, const char *name) : Broadcaster::~Broadcaster() { - LogSP log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); + Log *log (lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) log->Printf ("%p Broadcaster::~Broadcaster(\"%s\")", this, m_broadcaster_name.AsCString()); @@ -236,7 +236,7 @@ Broadcaster::PrivateBroadcastEvent (EventSP &event_sp, bool unique) hijacking_listener = NULL; } - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EVENTS)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EVENTS)); if (log) { StreamString event_description; @@ -294,7 +294,7 @@ Broadcaster::HijackBroadcaster (Listener *listener, uint32_t event_mask) { Mutex::Locker event_types_locker(m_listeners_mutex); - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EVENTS)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EVENTS)); if (log) { log->Printf ("%p Broadcaster(\"%s\")::HijackBroadcaster (listener(\"%s\")=%p)", @@ -313,7 +313,7 @@ Broadcaster::RestoreBroadcaster () { Mutex::Locker event_types_locker(m_listeners_mutex); - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EVENTS)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EVENTS)); if (log) { Listener *listener = m_hijacking_listeners.back(); diff --git a/lldb/source/Core/Communication.cpp b/lldb/source/Core/Communication.cpp index b55698880a5..51bf4c39706 100644 --- a/lldb/source/Core/Communication.cpp +++ b/lldb/source/Core/Communication.cpp @@ -338,7 +338,7 @@ Communication::ReadThread (void *p) { Communication *comm = (Communication *)p; - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_COMMUNICATION)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_COMMUNICATION)); if (log) log->Printf ("%p Communication::ReadThread () thread starting...", p); @@ -377,10 +377,10 @@ Communication::ReadThread (void *p) case eConnectionStatusError: // Check GetError() for details case eConnectionStatusTimedOut: // Request timed out if (log) - error.LogIfError(log.get(), - "%p Communication::ReadFromConnection () => status = %s", - p, - Communication::ConnectionStatusAsCString (status)); + error.LogIfError (log, + "%p Communication::ReadFromConnection () => status = %s", + p, + Communication::ConnectionStatusAsCString (status)); break; } } diff --git a/lldb/source/Core/ConnectionFileDescriptor.cpp b/lldb/source/Core/ConnectionFileDescriptor.cpp index a511ee20a89..cf8944a8e18 100644 --- a/lldb/source/Core/ConnectionFileDescriptor.cpp +++ b/lldb/source/Core/ConnectionFileDescriptor.cpp @@ -90,7 +90,7 @@ ConnectionFileDescriptor::ConnectionFileDescriptor () : m_mutex (Mutex::eMutexTypeRecursive), m_shutting_down (false) { - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION | LIBLLDB_LOG_OBJECT)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION | LIBLLDB_LOG_OBJECT)); if (log) log->Printf ("%p ConnectionFileDescriptor::ConnectionFileDescriptor ()", this); } @@ -109,7 +109,7 @@ ConnectionFileDescriptor::ConnectionFileDescriptor (int fd, bool owns_fd) : m_mutex (Mutex::eMutexTypeRecursive), m_shutting_down (false) { - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION | LIBLLDB_LOG_OBJECT)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION | LIBLLDB_LOG_OBJECT)); if (log) log->Printf ("%p ConnectionFileDescriptor::ConnectionFileDescriptor (fd = %i, owns_fd = %i)", this, fd, owns_fd); OpenCommandPipe (); @@ -118,7 +118,7 @@ ConnectionFileDescriptor::ConnectionFileDescriptor (int fd, bool owns_fd) : ConnectionFileDescriptor::~ConnectionFileDescriptor () { - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION | LIBLLDB_LOG_OBJECT)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION | LIBLLDB_LOG_OBJECT)); if (log) log->Printf ("%p ConnectionFileDescriptor::~ConnectionFileDescriptor ()", this); Disconnect (NULL); @@ -130,7 +130,7 @@ ConnectionFileDescriptor::OpenCommandPipe () { CloseCommandPipe(); - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); // Make the command file descriptor here: int filedes[2]; int result = pipe (filedes); @@ -174,7 +174,7 @@ ConnectionStatus ConnectionFileDescriptor::Connect (const char *s, Error *error_ptr) { Mutex::Locker locker (m_mutex); - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); if (log) log->Printf ("%p ConnectionFileDescriptor::Connect (url = '%s')", this, s); @@ -295,7 +295,7 @@ ConnectionFileDescriptor::Connect (const char *s, Error *error_ptr) ConnectionStatus ConnectionFileDescriptor::Disconnect (Error *error_ptr) { - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); if (log) log->Printf ("%p ConnectionFileDescriptor::Disconnect ()", this); @@ -370,7 +370,7 @@ ConnectionFileDescriptor::Read (void *dst, ConnectionStatus &status, Error *error_ptr) { - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); if (log) log->Printf ("%p ConnectionFileDescriptor::Read () ::read (fd = %i, dst = %p, dst_len = %" PRIu64 ")...", this, m_fd_recv, dst, (uint64_t)dst_len); @@ -482,7 +482,7 @@ ConnectionFileDescriptor::Read (void *dst, size_t ConnectionFileDescriptor::Write (const void *src, size_t src_len, ConnectionStatus &status, Error *error_ptr) { - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); if (log) log->Printf ("%p ConnectionFileDescriptor::Write (src = %p, src_len = %" PRIu64 ")", this, src, (uint64_t)src_len); @@ -620,7 +620,7 @@ ConnectionFileDescriptor::BytesAvailable (uint32_t timeout_usec, Error *error_pt // Don't need to take the mutex here separately since we are only called from Read. If we // ever get used more generally we will need to lock here as well. - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); if (log) log->Printf("%p ConnectionFileDescriptor::BytesAvailable (timeout_usec = %u)", this, timeout_usec); struct timeval *tv_ptr; @@ -770,7 +770,7 @@ ConnectionFileDescriptor::BytesAvailable (uint32_t timeout_usec, Error *error_pt // Don't need to take the mutex here separately since we are only called from Read. If we // ever get used more generally we will need to lock here as well. - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); if (log) log->Printf("%p ConnectionFileDescriptor::BytesAvailable (timeout_usec = %u)", this, timeout_usec); struct timeval *tv_ptr; @@ -927,7 +927,7 @@ ConnectionFileDescriptor::BytesAvailable (uint32_t timeout_usec, Error *error_pt // Don't need to take the mutex here separately since we are only called from Read. If we // ever get used more generally we will need to lock here as well. - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); if (log) log->Printf("%p ConnectionFileDescriptor::BytesAvailable (timeout_usec = %u)", this, timeout_usec); int timeout_msec = 0; @@ -1068,7 +1068,7 @@ ConnectionFileDescriptor::Close (int& fd, Error *error_ptr) // can get into the close scope below if (fd >= 0) { - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); if (log) log->Printf ("%p ConnectionFileDescriptor::Close (fd = %i)", this,fd); @@ -1177,7 +1177,7 @@ ConnectionFileDescriptor::NamedSocketConnect (const char *socket_name, Error *er ConnectionStatus ConnectionFileDescriptor::SocketListen (uint16_t listen_port_num, Error *error_ptr) { - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); if (log) log->Printf ("%p ConnectionFileDescriptor::SocketListen (port = %i)", this, listen_port_num); @@ -1240,7 +1240,7 @@ ConnectionFileDescriptor::SocketListen (uint16_t listen_port_num, Error *error_p ConnectionStatus ConnectionFileDescriptor::ConnectTCP (const char *host_and_port, Error *error_ptr) { - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); if (log) log->Printf ("%p ConnectionFileDescriptor::ConnectTCP (host/port = %s)", this, host_and_port); Disconnect (NULL); @@ -1314,7 +1314,7 @@ ConnectionFileDescriptor::ConnectTCP (const char *host_and_port, Error *error_pt ConnectionStatus ConnectionFileDescriptor::ConnectUDP (const char *host_and_port, Error *error_ptr) { - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_CONNECTION)); if (log) log->Printf ("%p ConnectionFileDescriptor::ConnectUDP (host/port = %s)", this, host_and_port); Disconnect (NULL); diff --git a/lldb/source/Core/DataBufferMemoryMap.cpp b/lldb/source/Core/DataBufferMemoryMap.cpp index d1131ae865f..f52072bd27a 100644 --- a/lldb/source/Core/DataBufferMemoryMap.cpp +++ b/lldb/source/Core/DataBufferMemoryMap.cpp @@ -83,7 +83,7 @@ DataBufferMemoryMap::Clear() { if (m_mmap_addr != NULL) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_MMAP)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_MMAP)); if (log) log->Printf("DataBufferMemoryMap::Clear() m_mmap_addr = %p, m_mmap_size = %zu", m_mmap_addr, m_mmap_size); ::munmap((void *)m_mmap_addr, m_mmap_size); @@ -110,7 +110,7 @@ DataBufferMemoryMap::MemoryMapFromFileSpec (const FileSpec* filespec, { if (filespec != NULL) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_MMAP)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_MMAP)); if (log) { log->Printf("DataBufferMemoryMap::MemoryMapFromFileSpec(file=\"%s/%s\", offset=0x%" PRIx64 ", length=0x%" PRIx64 ", writeable=%i", @@ -164,7 +164,7 @@ DataBufferMemoryMap::MemoryMapFromFileDescriptor (int fd, Clear(); if (fd >= 0) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_MMAP|LIBLLDB_LOG_VERBOSE)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_MMAP|LIBLLDB_LOG_VERBOSE)); if (log) { log->Printf("DataBufferMemoryMap::MemoryMapFromFileSpec(fd=%i, offset=0x%" PRIx64 ", length=0x%" PRIx64 ", writeable=%i, fd_is_file=%i)", diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp index 20c55e63c7a..f9d096118b5 100644 --- a/lldb/source/Core/Debugger.cpp +++ b/lldb/source/Core/Debugger.cpp @@ -1117,7 +1117,7 @@ ScanFormatDescriptor (const char* var_name_begin, Format* custom_format, ValueObject::ValueObjectRepresentationStyle* val_obj_display) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); *percent_position = ::strchr(var_name_begin,'%'); if (!*percent_position || *percent_position > var_name_end) { @@ -1184,7 +1184,7 @@ ScanBracketedRange (const char* var_name_begin, int64_t* index_lower, int64_t* index_higher) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); *open_bracket_position = ::strchr(var_name_begin,'['); if (*open_bracket_position && *open_bracket_position < var_name_final) { @@ -1241,7 +1241,7 @@ ExpandIndexedExpression (ValueObject* valobj, StackFrame* frame, bool deref_pointer) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); const char* ptr_deref_format = "[%d]"; std::string ptr_deref_buffer(10,0); ::sprintf(&ptr_deref_buffer[0], ptr_deref_format, index); @@ -1290,7 +1290,7 @@ Debugger::FormatPrompt ValueObject* realvalobj = NULL; // makes it super-easy to parse pointers bool success = true; const char *p; - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); for (p = format; *p != '\0'; ++p) { if (realvalobj) diff --git a/lldb/source/Core/Listener.cpp b/lldb/source/Core/Listener.cpp index 79fa9cf373c..4b6a964b8ae 100644 --- a/lldb/source/Core/Listener.cpp +++ b/lldb/source/Core/Listener.cpp @@ -32,14 +32,14 @@ Listener::Listener(const char *name) : m_events_mutex (Mutex::eMutexTypeRecursive), m_cond_wait() { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); if (log) log->Printf ("%p Listener::Listener('%s')", this, m_name.c_str()); } Listener::~Listener() { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_OBJECT)); Mutex::Locker locker (m_broadcasters_mutex); size_t num_managers = m_broadcaster_managers.size(); @@ -84,7 +84,7 @@ Listener::StartListeningForEvents (Broadcaster* broadcaster, uint32_t event_mask { } - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EVENTS)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EVENTS)); if (log) log->Printf ("%p Listener::StartListeningForEvents (broadcaster = %p, mask = 0x%8.8x) acquired_mask = 0x%8.8x for %s", this, @@ -113,7 +113,7 @@ Listener::StartListeningForEvents (Broadcaster* broadcaster, uint32_t event_mask uint32_t acquired_mask = broadcaster->AddListener (this, event_mask); - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EVENTS)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EVENTS)); if (log) log->Printf ("%p Listener::StartListeningForEvents (broadcaster = %p, mask = 0x%8.8x, callback = %p, user_data = %p) acquired_mask = 0x%8.8x for %s", this, broadcaster, event_mask, callback, callback_user_data, acquired_mask, m_name.c_str()); @@ -183,7 +183,7 @@ Listener::BroadcasterManagerWillDestruct (BroadcasterManager *manager) void Listener::AddEvent (EventSP &event_sp) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EVENTS)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EVENTS)); if (log) log->Printf ("%p Listener('%s')::AddEvent (event_sp = {%p})", this, m_name.c_str(), event_sp.get()); @@ -270,7 +270,7 @@ Listener::FindNextEventInternal EventSP &event_sp, bool remove) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EVENTS)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EVENTS)); Mutex::Locker lock(m_events_mutex); @@ -400,7 +400,7 @@ Listener::WaitForEventsInternal EventSP &event_sp ) { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EVENTS)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_EVENTS)); bool timed_out = false; if (log) diff --git a/lldb/source/Core/Log.cpp b/lldb/source/Core/Log.cpp index 3743631fbb7..881d9892fd7 100644 --- a/lldb/source/Core/Log.cpp +++ b/lldb/source/Core/Log.cpp @@ -41,7 +41,7 @@ Log::Log () : { } -Log::Log (StreamSP &stream_sp) : +Log::Log (const StreamSP &stream_sp) : m_stream_sp(stream_sp), m_options(0), m_mask_bits(0) @@ -517,7 +517,7 @@ LogChannel::FindPlugin (const char *plugin_name) } LogChannel::LogChannel () : - m_log_sp () + m_log_ap () { } diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp index 822fbd8f1c6..671d6e4c125 100644 --- a/lldb/source/Core/Module.cpp +++ b/lldb/source/Core/Module.cpp @@ -152,7 +152,7 @@ Module::Module (const ModuleSpec &module_spec) : GetModuleCollection().push_back(this); } - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_OBJECT|LIBLLDB_LOG_MODULES)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_OBJECT|LIBLLDB_LOG_MODULES)); if (log) log->Printf ("%p Module::Module((%s) '%s/%s%s%s%s')", this, @@ -197,7 +197,7 @@ Module::Module(const FileSpec& file_spec, if (object_name) m_object_name = *object_name; - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_OBJECT|LIBLLDB_LOG_MODULES)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_OBJECT|LIBLLDB_LOG_MODULES)); if (log) log->Printf ("%p Module::Module((%s) '%s/%s%s%s%s')", this, @@ -220,7 +220,7 @@ Module::~Module() assert (pos != end); modules.erase(pos); } - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_OBJECT|LIBLLDB_LOG_MODULES)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_OBJECT|LIBLLDB_LOG_MODULES)); if (log) log->Printf ("%p Module::~Module((%s) '%s/%s%s%s%s')", this, diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index 05dc3e3a786..8e79a455182 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -596,9 +596,9 @@ ModuleList::Dump(Stream *s) const } void -ModuleList::LogUUIDAndPaths (LogSP &log_sp, const char *prefix_cstr) +ModuleList::LogUUIDAndPaths (Log *log, const char *prefix_cstr) { - if (log_sp) + if (log) { Mutex::Locker locker(m_modules_mutex); char uuid_cstr[256]; @@ -608,13 +608,13 @@ ModuleList::LogUUIDAndPaths (LogSP &log_sp, const char *prefix_cstr) Module *module = pos->get(); module->GetUUID().GetAsCString (uuid_cstr, sizeof(uuid_cstr)); const FileSpec &module_file_spec = module->GetFileSpec(); - log_sp->Printf ("%s[%u] %s (%s) \"%s/%s\"", - prefix_cstr ? prefix_cstr : "", - (uint32_t)std::distance (begin, pos), - uuid_cstr, - module->GetArchitecture().GetArchitectureName(), - module_file_spec.GetDirectory().GetCString(), - module_file_spec.GetFilename().GetCString()); + log->Printf ("%s[%u] %s (%s) \"%s/%s\"", + prefix_cstr ? prefix_cstr : "", + (uint32_t)std::distance (begin, pos), + uuid_cstr, + module->GetArchitecture().GetArchitectureName(), + module_file_spec.GetDirectory().GetCString(), + module_file_spec.GetFilename().GetCString()); } } } @@ -791,7 +791,7 @@ ModuleList::GetSharedModule if (old_module_sp_ptr && !old_module_sp_ptr->get()) *old_module_sp_ptr = module_sp; - LogSP log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_MODULES)); + Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_MODULES)); if (log) log->Printf("module changed: %p, removing from global module list", module_sp.get()); diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 783fa129163..140c4b48b5e 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -229,7 +229,7 @@ ValueObject::UpdateValueIfNeeded (bool update_format) bool ValueObject::UpdateFormatsIfNeeded() { - LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); if (log) log->Printf("[%s %p] checking for FormatManager revisions. ValueObject rev: %d - Global rev: %d", GetName().GetCString(), diff --git a/lldb/source/Core/ValueObjectDynamicValue.cpp b/lldb/source/Core/ValueObjectDynamicValue.cpp index a90ef0286fb..f82c66602ba 100644 --- a/lldb/source/Core/ValueObjectDynamicValue.cpp +++ b/lldb/source/Core/ValueObjectDynamicValue.cpp @@ -202,7 +202,7 @@ ValueObjectDynamicValue::UpdateValue () Value old_value(m_value); - lldb::LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); + Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_TYPES)); bool has_changed_type = false; |