Fixed SBModule::GetUUIDString() to not use a static character buffer.
authorGreg Clayton <gclayton@apple.com>
Wed, 11 Feb 2015 19:16:38 +0000 (19:16 +0000)
committerGreg Clayton <gclayton@apple.com>
Wed, 11 Feb 2015 19:16:38 +0000 (19:16 +0000)
commitf1be855a002ec3bf17a8c16a1d8a18786646e740
treed0f78c0b7fdd188e4b17ba2a50a1c29bab694a68
parentc47edb51c68b399b1576b7306bad1b8cb7e39c28
Fixed SBModule::GetUUIDString() to not use a static character buffer.

Rules for returning "const char *" from functions in the public lldb::SB* API are that you must constify the string using "ConstString(cstr).GetCString()" and return that. This puts the string into a string pool that never goes away. This is only when there is nothing that can hold onto the string. It is OK to specify that a string value lives as long as its SB class counterpart, but this should be made clear in the API if this is done. Many classes already constify their strings (symbol mangled and demangled names, variable names, type names, etc), so be sure to verify you string isn't already constified before you re-constify it. It won't do any harm to re-constify it, it will just cause you a little performance by having to rehash the string.

llvm-svn: 228867
lldb/source/API/SBModule.cpp