diff options
author | Pavel Labath <labath@google.com> | 2017-06-06 14:06:17 +0000 |
---|---|---|
committer | Pavel Labath <labath@google.com> | 2017-06-06 14:06:17 +0000 |
commit | 10c41f37b5ae69ddaec7a81f5141cf00090bae22 (patch) | |
tree | 740dfdd2d7833262d11b08071bf76423e5bf5c3c /lldb/source/Commands/CommandObjectRegister.cpp | |
parent | 9f9422b69956beea6ff029b637d349e693f668b5 (diff) | |
download | llvm-10c41f37b5ae69ddaec7a81f5141cf00090bae22.zip llvm-10c41f37b5ae69ddaec7a81f5141cf00090bae22.tar.gz llvm-10c41f37b5ae69ddaec7a81f5141cf00090bae22.tar.bz2 |
replace uses of strerror with llvm::sys::StrError
strerror is not thread-safe. llvm's StrError tries hard to retrieve the
string in a thread-safe way and falls back to strerror only if it does
not have another way.
llvm-svn: 304795
Diffstat (limited to 'lldb/source/Commands/CommandObjectRegister.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectRegister.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp index 6de8c66..d535742 100644 --- a/lldb/source/Commands/CommandObjectRegister.cpp +++ b/lldb/source/Commands/CommandObjectRegister.cpp @@ -7,12 +7,6 @@ // //===----------------------------------------------------------------------===// -// C Includes -// C++ Includes -// Other libraries and framework includes -#include "llvm/ADT/STLExtras.h" - -// Project includes #include "CommandObjectRegister.h" #include "lldb/Core/Debugger.h" #include "lldb/Core/RegisterValue.h" @@ -32,6 +26,7 @@ #include "lldb/Target/SectionLoadList.h" #include "lldb/Target/Thread.h" #include "lldb/Utility/DataExtractor.h" +#include "llvm/Support/Errno.h" using namespace lldb; using namespace lldb_private; @@ -178,8 +173,8 @@ protected: if (set_idx < reg_ctx->GetRegisterSetCount()) { if (!DumpRegisterSet(m_exe_ctx, strm, reg_ctx, set_idx)) { if (errno) - result.AppendErrorWithFormat("register read failed: %s\n", - strerror(errno)); + result.AppendErrorWithFormatv("register read failed: {0}\n", + llvm::sys::StrError()); else result.AppendError("unknown error while reading registers.\n"); result.SetStatus(eReturnStatusFailed); |