diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2019-08-20 20:51:52 +0000 |
| commit | 5f29bb8a675e8f96452b632e7129113f7dec850e (patch) | |
| tree | 3d3f2a0d3ad10872a4dcaba8ec8d1d20c87ab147 /source/Plugins/InstrumentationRuntime | |
| parent | 88c643b6fec27eec436c8d138fee6346e92337d6 (diff) | |
Notes
Diffstat (limited to 'source/Plugins/InstrumentationRuntime')
8 files changed, 45 insertions, 58 deletions
diff --git a/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp b/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp index 9a6e39be0bfd..c8ac04641e68 100644 --- a/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp +++ b/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.cpp @@ -1,9 +1,8 @@ //===-- ASanRuntime.cpp -----------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -72,7 +71,6 @@ bool AddressSanitizerRuntime::CheckIfRuntimeIsValid( return symbol != nullptr; } -static constexpr std::chrono::seconds g_retrieve_report_data_function_timeout(2); const char *address_sanitizer_retrieve_report_data_prefix = R"( extern "C" { @@ -127,7 +125,7 @@ StructuredData::ObjectSP AddressSanitizerRuntime::RetrieveReportData() { options.SetTryAllThreads(true); options.SetStopOthers(true); options.SetIgnoreBreakpoints(true); - options.SetTimeout(g_retrieve_report_data_function_timeout); + options.SetTimeout(process_sp->GetUtilityExpressionTimeout()); options.SetPrefix(address_sanitizer_retrieve_report_data_prefix); options.SetAutoApplyFixIts(false); options.SetLanguage(eLanguageTypeObjC_plus_plus); @@ -289,7 +287,7 @@ void AddressSanitizerRuntime::Activate() { const Symbol *symbol = GetRuntimeModuleSP()->FindFirstSymbolWithNameAndType( symbol_name, eSymbolTypeCode); - if (symbol == NULL) + if (symbol == nullptr) return; if (!symbol->ValueIsAddress() || !symbol->GetAddressRef().IsValid()) diff --git a/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h b/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h index 1439f86e586f..0771e624ff6b 100644 --- a/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h +++ b/source/Plugins/InstrumentationRuntime/ASan/ASanRuntime.h @@ -1,9 +1,8 @@ -//===-- AddressSanitizerRuntime.h -------------------------------*- C++ -*-===// +//===-- ASanRuntime.h -------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp b/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp index 32da327ee465..dfe61316b042 100644 --- a/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp +++ b/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.cpp @@ -1,9 +1,8 @@ //===-- MainThreadCheckerRuntime.cpp ----------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -25,6 +24,8 @@ #include "lldb/Utility/RegularExpression.h" #include "Plugins/Process/Utility/HistoryThread.h" +#include <memory> + using namespace lldb; using namespace lldb_private; @@ -239,7 +240,7 @@ lldb::ThreadCollectionSP MainThreadCheckerRuntime::GetBacktracesFromExtendedStopInfo( StructuredData::ObjectSP info) { ThreadCollectionSP threads; - threads.reset(new ThreadCollection()); + threads = std::make_shared<ThreadCollection>(); ProcessSP process_sp = GetProcessSP(); @@ -260,11 +261,8 @@ MainThreadCheckerRuntime::GetBacktracesFromExtendedStopInfo( StructuredData::ObjectSP thread_id_obj = info->GetObjectForDotSeparatedPath("tid"); tid_t tid = thread_id_obj ? thread_id_obj->GetIntegerValue() : 0; - - uint32_t stop_id = 0; - bool stop_id_is_valid = false; - HistoryThread *history_thread = - new HistoryThread(*process_sp, tid, PCs, stop_id, stop_id_is_valid); + + HistoryThread *history_thread = new HistoryThread(*process_sp, tid, PCs); ThreadSP new_thread_sp(history_thread); // Save this in the Process' ExtendedThreadList so a strong pointer retains diff --git a/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h b/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h index 516d9fef5e8e..1dcbc0f6bc89 100644 --- a/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h +++ b/source/Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h @@ -1,9 +1,8 @@ //===-- MainThreadCheckerRuntime.h ------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp b/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp index 6ce50f5c6839..89f2139db71b 100644 --- a/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp +++ b/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.cpp @@ -1,9 +1,8 @@ //===-- TSanRuntime.cpp -----------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -31,6 +30,8 @@ #include "lldb/Utility/RegularExpression.h" #include "lldb/Utility/Stream.h" +#include <memory> + using namespace lldb; using namespace lldb_private; @@ -59,8 +60,6 @@ lldb::InstrumentationRuntimeType ThreadSanitizerRuntime::GetTypeStatic() { ThreadSanitizerRuntime::~ThreadSanitizerRuntime() { Deactivate(); } -static constexpr std::chrono::seconds g_retrieve_data_function_timeout(2); - const char *thread_sanitizer_retrieve_report_data_prefix = R"( extern "C" { @@ -317,7 +316,7 @@ ThreadSanitizerRuntime::RetrieveReportData(ExecutionContextRef exe_ctx_ref) { options.SetTryAllThreads(true); options.SetStopOthers(true); options.SetIgnoreBreakpoints(true); - options.SetTimeout(g_retrieve_data_function_timeout); + options.SetTimeout(process_sp->GetUtilityExpressionTimeout()); options.SetPrefix(thread_sanitizer_retrieve_report_data_prefix); options.SetAutoApplyFixIts(false); options.SetLanguage(eLanguageTypeObjC_plus_plus); @@ -901,7 +900,7 @@ void ThreadSanitizerRuntime::Activate() { const Symbol *symbol = GetRuntimeModuleSP()->FindFirstSymbolWithNameAndType( symbol_name, eSymbolTypeCode); - if (symbol == NULL) + if (symbol == nullptr) return; if (!symbol->ValueIsAddress() || !symbol->GetAddressRef().IsValid()) @@ -1031,10 +1030,8 @@ static void AddThreadsForPath(const std::string &path, o->GetObjectForDotSeparatedPath("thread_os_id"); tid_t tid = thread_id_obj ? thread_id_obj->GetIntegerValue() : 0; - uint32_t stop_id = 0; - bool stop_id_is_valid = false; HistoryThread *history_thread = - new HistoryThread(*process_sp, tid, pcs, stop_id, stop_id_is_valid); + new HistoryThread(*process_sp, tid, pcs); ThreadSP new_thread_sp(history_thread); new_thread_sp->SetName(GenerateThreadName(path, o, info).c_str()); @@ -1051,7 +1048,7 @@ lldb::ThreadCollectionSP ThreadSanitizerRuntime::GetBacktracesFromExtendedStopInfo( StructuredData::ObjectSP info) { ThreadCollectionSP threads; - threads.reset(new ThreadCollection()); + threads = std::make_shared<ThreadCollection>(); if (info->GetObjectForDotSeparatedPath("instrumentation_class") ->GetStringValue() != "ThreadSanitizer") diff --git a/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h b/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h index e6482d394efa..db8bb1db7996 100644 --- a/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h +++ b/source/Plugins/InstrumentationRuntime/TSan/TSanRuntime.h @@ -1,9 +1,8 @@ -//===-- ThreadSanitizerRuntime.h --------------------------------*- C++ -*-===// +//===-- TSanRuntime.h -------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// diff --git a/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp b/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp index 1e9280c8c064..367098bb448e 100644 --- a/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp +++ b/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.cpp @@ -1,9 +1,8 @@ //===-- UBSanRuntime.cpp ----------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// @@ -32,6 +31,8 @@ #include "lldb/Utility/Stream.h" #include <ctype.h> +#include <memory> + using namespace lldb; using namespace lldb_private; @@ -130,7 +131,7 @@ StructuredData::ObjectSP UndefinedBehaviorSanitizerRuntime::RetrieveReportData( options.SetTryAllThreads(true); options.SetStopOthers(true); options.SetIgnoreBreakpoints(true); - options.SetTimeout(std::chrono::seconds(2)); + options.SetTimeout(process_sp->GetUtilityExpressionTimeout()); options.SetPrefix(ub_sanitizer_retrieve_report_data_prefix); options.SetAutoApplyFixIts(false); options.SetLanguage(eLanguageTypeObjC_plus_plus); @@ -304,7 +305,7 @@ lldb::ThreadCollectionSP UndefinedBehaviorSanitizerRuntime::GetBacktracesFromExtendedStopInfo( StructuredData::ObjectSP info) { ThreadCollectionSP threads; - threads.reset(new ThreadCollection()); + threads = std::make_shared<ThreadCollection>(); ProcessSP process_sp = GetProcessSP(); @@ -326,10 +327,7 @@ UndefinedBehaviorSanitizerRuntime::GetBacktracesFromExtendedStopInfo( info->GetObjectForDotSeparatedPath("tid"); tid_t tid = thread_id_obj ? thread_id_obj->GetIntegerValue() : 0; - uint32_t stop_id = 0; - bool stop_id_is_valid = false; - HistoryThread *history_thread = - new HistoryThread(*process_sp, tid, PCs, stop_id, stop_id_is_valid); + HistoryThread *history_thread = new HistoryThread(*process_sp, tid, PCs); ThreadSP new_thread_sp(history_thread); std::string stop_reason_description = GetStopReasonDescription(info); new_thread_sp->SetName(stop_reason_description.c_str()); diff --git a/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h b/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h index 8f138fc12073..1d854b7bf06f 100644 --- a/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h +++ b/source/Plugins/InstrumentationRuntime/UBSan/UBSanRuntime.h @@ -1,9 +1,8 @@ -//===-- UndefinedBehaviorSanitizerRuntime.h ---------------------*- C++ -*-===// +//===-- UBSanRuntime.h ------------------------------------------*- C++ -*-===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// |
