summaryrefslogtreecommitdiff
path: root/lldb/source/API/SBModule.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2013-05-03 23:56:12 +0000
committerJason Molenda <jmolenda@apple.com>2013-05-03 23:56:12 +0000
commitc16b4af0d7aa1bd6b5657474cc46482aa158c3ec (patch)
tree3ac4632102f1a5dd55e09a9bebc31f8dc5a3d064 /lldb/source/API/SBModule.cpp
parent47752e489e30f029f59ab70cbf18c1d35618e74f (diff)
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/API/SBModule.cpp')
-rw-r--r--lldb/source/API/SBModule.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/lldb/source/API/SBModule.cpp b/lldb/source/API/SBModule.cpp
index 85bece899964..3938fa8846d0 100644
--- a/lldb/source/API/SBModule.cpp
+++ b/lldb/source/API/SBModule.cpp
@@ -180,15 +180,22 @@ SBModule::GetUUIDString () const
{
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
- static char uuid_string[80];
- const char * uuid_c_string = NULL;
+ static char uuid_string_buffer[80];
+ const char *uuid_c_string = NULL;
+ std::string uuid_string;
ModuleSP module_sp (GetSP ());
if (module_sp)
- uuid_c_string = (const char *)module_sp->GetUUID().GetAsCString(uuid_string, sizeof(uuid_string));
+ uuid_string = module_sp->GetUUID().GetAsString();
+
+ if (!uuid_string.empty())
+ {
+ strncpy (uuid_string_buffer, uuid_string.c_str(), sizeof (uuid_string_buffer));
+ uuid_c_string = uuid_string_buffer;
+ }
if (log)
{
- if (uuid_c_string)
+ if (!uuid_string.empty())
{
StreamString s;
module_sp->GetUUID().Dump (&s);