diff --git a/lldb/include/lldb/Interpreter/ScriptedInterface.h b/lldb/include/lldb/Interpreter/ScriptedInterface.h --- a/lldb/include/lldb/Interpreter/ScriptedInterface.h +++ b/lldb/include/lldb/Interpreter/ScriptedInterface.h @@ -9,16 +9,14 @@ #ifndef LLDB_INTERPRETER_SCRIPTEDINTERFACE_H #define LLDB_INTERPRETER_SCRIPTEDINTERFACE_H -#ifdef _MSC_VER -#define __PRETTY_FUNCTION__ __FUNCSIG__ -#endif - #include "lldb/Core/StructuredDataImpl.h" #include "lldb/Target/ExecutionContext.h" #include "lldb/Utility/Log.h" #include "lldb/Utility/Logging.h" #include "lldb/lldb-private.h" +#include "llvm/Support/Compiler.h" + #include namespace lldb_private { diff --git a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp --- a/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp +++ b/lldb/source/Plugins/Process/scripted/ScriptedProcess.cpp @@ -233,7 +233,7 @@ size_t ScriptedProcess::DoReadMemory(lldb::addr_t addr, void *buf, size_t size, Status &error) { if (!m_interpreter) - return GetInterface().ErrorWithMessage(__PRETTY_FUNCTION__, + return GetInterface().ErrorWithMessage(LLVM_PRETTY_FUNCTION, "No interpreter.", error); lldb::DataExtractorSP data_extractor_sp = @@ -247,7 +247,7 @@ if (!bytes_copied || bytes_copied == LLDB_INVALID_OFFSET) return GetInterface().ErrorWithMessage( - __PRETTY_FUNCTION__, "Failed to copy read memory to buffer.", error); + LLVM_PRETTY_FUNCTION, "Failed to copy read memory to buffer.", error); return size; } @@ -304,7 +304,7 @@ if (language != eScriptLanguagePython) return GetInterface().ErrorWithMessage( - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, llvm::Twine("ScriptInterpreter language (" + llvm::Twine(m_interpreter->LanguageToString(language)) + llvm::Twine(") not supported.")) @@ -315,7 +315,7 @@ thread_sp = std::make_shared(*this, error); if (!thread_sp || error.Fail()) - return GetInterface().ErrorWithMessage(__PRETTY_FUNCTION__, + return GetInterface().ErrorWithMessage(LLVM_PRETTY_FUNCTION, error.AsCString(), error); new_thread_list.AddThread(thread_sp); diff --git a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp --- a/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp +++ b/lldb/source/Plugins/Process/scripted/ScriptedThread.cpp @@ -141,13 +141,13 @@ if (!dict_sp->GetValueForKeyAsInteger("type", stop_reason_type)) return GetInterface()->ErrorWithMessage( - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, "Couldn't find value for key 'type' in stop reason dictionary.", error); StructuredData::Dictionary *data_dict; if (!dict_sp->GetValueForKeyAsDictionary("data", data_dict)) return GetInterface()->ErrorWithMessage( - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, "Couldn't find value for key 'type' in stop reason dictionary.", error); switch (stop_reason_type) { @@ -171,7 +171,7 @@ } break; default: return GetInterface()->ErrorWithMessage( - __PRETTY_FUNCTION__, + LLVM_PRETTY_FUNCTION, llvm::Twine("Unsupported stop reason type (" + llvm::Twine(stop_reason_type) + llvm::Twine(").")) .str(), diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedProcessPythonInterface.cpp @@ -72,7 +72,7 @@ Status error; StructuredData::ObjectSP obj = Dispatch("is_alive", error); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, obj, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error)) return {}; return obj->GetBooleanValue(); @@ -89,7 +89,7 @@ "get_memory_region_containing_address", error, address); if (error.Fail()) { - return ErrorWithMessage(__PRETTY_FUNCTION__, + return ErrorWithMessage(LLVM_PRETTY_FUNCTION, error.AsCString(), error); } @@ -101,7 +101,7 @@ Status error; StructuredData::ObjectSP obj = Dispatch("get_thread_with_id", error, tid); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, obj, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error)) return {}; StructuredData::DictionarySP dict{obj->GetAsDictionary()}; @@ -130,7 +130,7 @@ Status error; StructuredData::ObjectSP obj = Dispatch("get_process_id", error); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, obj, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error)) return LLDB_INVALID_PROCESS_ID; return obj->GetIntegerValue(LLDB_INVALID_PROCESS_ID); @@ -140,7 +140,7 @@ Status error; StructuredData::ObjectSP obj = Dispatch("is_alive", error); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, obj, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error)) return {}; return obj->GetBooleanValue(); @@ -151,7 +151,7 @@ Status error; StructuredData::ObjectSP obj = Dispatch("get_scripted_thread_plugin", error); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, obj, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error)) return {}; return obj->GetStringValue().str(); diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedPythonInterface.h @@ -39,7 +39,7 @@ using Locker = ScriptInterpreterPythonImpl::Locker; std::string caller_signature = - llvm::Twine(__PRETTY_FUNCTION__ + llvm::Twine(" (") + + llvm::Twine(LLVM_PRETTY_FUNCTION + llvm::Twine(" (") + llvm::Twine(method_name) + llvm::Twine(")")) .str(); if (!m_object_instance_sp) diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptedThreadPythonInterface.cpp @@ -60,7 +60,7 @@ Status error; StructuredData::ObjectSP obj = Dispatch("get_thread_id", error); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, obj, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error)) return LLDB_INVALID_THREAD_ID; return obj->GetIntegerValue(LLDB_INVALID_THREAD_ID); @@ -70,7 +70,7 @@ Status error; StructuredData::ObjectSP obj = Dispatch("get_name", error); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, obj, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error)) return {}; return obj->GetStringValue().str(); @@ -80,7 +80,7 @@ Status error; StructuredData::ObjectSP obj = Dispatch("get_state", error); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, obj, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error)) return eStateInvalid; return static_cast(obj->GetIntegerValue(eStateInvalid)); @@ -90,7 +90,7 @@ Status error; StructuredData::ObjectSP obj = Dispatch("get_queue", error); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, obj, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error)) return {}; return obj->GetStringValue().str(); @@ -101,7 +101,7 @@ StructuredData::DictionarySP dict = Dispatch("get_stop_reason", error); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, dict, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error)) return {}; return dict; @@ -116,7 +116,7 @@ StructuredData::DictionarySP dict = Dispatch("get_register_info", error); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, dict, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, dict, error)) return {}; return dict; @@ -127,7 +127,7 @@ Status error; StructuredData::ObjectSP obj = Dispatch("get_register_context", error); - if (!CheckStructuredDataObject(__PRETTY_FUNCTION__, obj, error)) + if (!CheckStructuredDataObject(LLVM_PRETTY_FUNCTION, obj, error)) return {}; return obj->GetAsString()->GetValue().str();