diff options
author | Jason Molenda <jmolenda@apple.com> | 2013-05-03 23:56:12 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2013-05-03 23:56:12 +0000 |
commit | c16b4af0d7aa1bd6b5657474cc46482aa158c3ec (patch) | |
tree | 3ac4632102f1a5dd55e09a9bebc31f8dc5a3d064 /lldb/source/Core/ModuleList.cpp | |
parent | 47752e489e30f029f59ab70cbf18c1d35618e74f (diff) | |
download | bcm5719-llvm-c16b4af0d7aa1bd6b5657474cc46482aa158c3ec.tar.gz bcm5719-llvm-c16b4af0d7aa1bd6b5657474cc46482aa158c3ec.zip |
Remove the UUID::GetAsCString() method which required a buffer to save the
UUID string in; added UUID::GetAsString() which returns the uuid string in
a std::string. Updated callers to use the new method.
llvm-svn: 181078
Diffstat (limited to 'lldb/source/Core/ModuleList.cpp')
-rw-r--r-- | lldb/source/Core/ModuleList.cpp | 24 |
1 files changed, 9 insertions, 15 deletions
diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index ff5d22537c4..376d046eb61 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -651,17 +651,15 @@ ModuleList::LogUUIDAndPaths (Log *log, const char *prefix_cstr) if (log) { Mutex::Locker locker(m_modules_mutex); - char uuid_cstr[256]; collection::const_iterator pos, begin = m_modules.begin(), end = m_modules.end(); for (pos = begin; pos != end; ++pos) { Module *module = pos->get(); - module->GetUUID().GetAsCString (uuid_cstr, sizeof(uuid_cstr)); const FileSpec &module_file_spec = module->GetFileSpec(); log->Printf ("%s[%u] %s (%s) \"%s\"", prefix_cstr ? prefix_cstr : "", (uint32_t)std::distance (begin, pos), - uuid_cstr, + module->GetUUID().GetAsString().c_str(), module->GetArchitecture().GetArchitectureName(), module_file_spec.GetPath().c_str()); } @@ -806,7 +804,6 @@ ModuleList::GetSharedModule ModuleList &shared_module_list = GetSharedModuleList (); Mutex::Locker locker(shared_module_list.m_modules_mutex); char path[PATH_MAX]; - char uuid_cstr[64]; Error error; @@ -906,16 +903,14 @@ ModuleList::GetSharedModule module_file_spec.GetPath(path, sizeof(path)); if (file_spec.Exists()) { + std::string uuid_str; if (uuid_ptr && uuid_ptr->IsValid()) - uuid_ptr->GetAsCString(uuid_cstr, sizeof (uuid_cstr)); - else - uuid_cstr[0] = '\0'; - + uuid_str = uuid_ptr->GetAsString(); if (arch.IsValid()) { - if (uuid_cstr[0]) - error.SetErrorStringWithFormat("'%s' does not contain the %s architecture and UUID %s", path, arch.GetArchitectureName(), uuid_cstr); + if (!uuid_str.empty()) + error.SetErrorStringWithFormat("'%s' does not contain the %s architecture and UUID %s", path, arch.GetArchitectureName(), uuid_str.c_str()); else error.SetErrorStringWithFormat("'%s' does not contain the %s architecture.", path, arch.GetArchitectureName()); } @@ -985,13 +980,12 @@ ModuleList::GetSharedModule } else { + std::string uuid_str; if (uuid_ptr && uuid_ptr->IsValid()) - uuid_ptr->GetAsCString(uuid_cstr, sizeof (uuid_cstr)); - else - uuid_cstr[0] = '\0'; + uuid_str = uuid_ptr->GetAsString(); - if (uuid_cstr[0]) - error.SetErrorStringWithFormat("cannot locate a module for UUID '%s'", uuid_cstr); + if (!uuid_str.empty()) + error.SetErrorStringWithFormat("cannot locate a module for UUID '%s'", uuid_str.c_str()); else error.SetErrorStringWithFormat("cannot locate a module"); } |