Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/coreclr/debug/createdump/crashinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ CrashInfo::EnumerateManagedModules()
}

DacpGetModuleData moduleData;
if (SUCCEEDED(hr = moduleData.Request(pClrDataModule.GetPtr())))
if (SUCCEEDED(hr = moduleData.Request(pClrDataModule)))
{
uint64_t loadedPEAddress = CONVERT_FROM_SIGN_EXTENDED(moduleData.LoadedPEAddress);

Expand All @@ -464,10 +464,10 @@ CrashInfo::EnumerateManagedModules()

if (!moduleData.IsDynamic && loadedPEAddress != 0)
{
ArrayHolder<WCHAR> wszUnicodeName = new WCHAR[MAX_LONGPATH + 1];
WStringHolder wszUnicodeName = new WCHAR[MAX_LONGPATH + 1];
if (SUCCEEDED(hr = pClrDataModule->GetFileName(MAX_LONGPATH, nullptr, wszUnicodeName)))
{
std::string moduleName = ConvertString(wszUnicodeName.GetPtr());
std::string moduleName = ConvertString(wszUnicodeName);

// Change the module mapping name
AddOrReplaceModuleMapping(loadedPEAddress, moduleData.LoadedPESize, moduleName);
Expand Down Expand Up @@ -1009,7 +1009,7 @@ GetDirectory(const std::string& fileName)
std::string
FormatString(const char* format, ...)
{
ArrayHolder<char> buffer = new char[MAX_LONGPATH + 1];
AStringHolder buffer = new char[MAX_LONGPATH + 1];
va_list args;
va_start(args, format);
int result = vsnprintf(buffer, MAX_LONGPATH, format, args);
Expand All @@ -1031,7 +1031,7 @@ ConvertString(const WCHAR* str)
if (len == 0)
return { };

ArrayHolder<char> buffer = new char[len + 1];
AStringHolder buffer = new char[len + 1];
minipal_convert_utf16_to_utf8((CHAR16_T*)str, cch, buffer, len + 1, 0);
return std::string { buffer };
}
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/debug/createdump/crashreportwriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ CrashReportWriter::WriteSysctl(const char* sysctlname, const char* valueName)
size_t size = 0;
if (sysctlbyname(sysctlname, nullptr, &size, NULL, 0) >= 0)
{
ArrayHolder<char> buffer = new char[size];
AStringHolder buffer = new char[size];
if (sysctlbyname(sysctlname, buffer, &size, NULL, 0) >= 0)
{
WriteValue(valueName, buffer);
Expand Down Expand Up @@ -232,10 +232,10 @@ CrashReportWriter::WriteStackFrame(const StackFrame& frame)
IXCLRDataMethodInstance* pMethod = frame.GetMethod();
if (pMethod != nullptr)
{
ArrayHolder<WCHAR> wszUnicodeName = new WCHAR[MAX_LONGPATH + 1];
WStringHolder wszUnicodeName = new WCHAR[MAX_LONGPATH + 1];
if (SUCCEEDED(pMethod->GetName(0, MAX_LONGPATH, nullptr, wszUnicodeName)))
{
std::string methodName = ConvertString(wszUnicodeName.GetPtr());
std::string methodName = ConvertString(wszUnicodeName);
WriteValue("method_name", methodName.c_str());
}
}
Expand Down
15 changes: 13 additions & 2 deletions src/coreclr/debug/createdump/createdump.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,19 @@ extern void trace_verbose_printf(const char* format, ...);
#include <mscoree.h>
typedef int T_CONTEXT;
#include <dacprivate.h>
#include <arrayholder.h>
#include <releaseholder.h>

#ifndef _ASSERTE
#define _ASSERTE(expr) assert(expr)
#define UNDEF__ASSERTE
#endif // _ASSERTE

#include <holder.h>

#ifdef UNDEF__ASSERTE
#undef _ASSERTE
#undef UNDEF__ASSERTE
#endif // UNDEF__ASSERTE

#ifdef HOST_UNIX
#include <minipal/strings.h>
#include <minipal/utf8.h>
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/createdump/createdumpmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ int createdump_main(const int argc, const char* argv[])
g_startTime = minipal_hires_ticks();
TRACE("TickFrequency: %d ticks per ms\n", g_ticksPerMS);

ArrayHolder<char> tmpPath = new char[MAX_LONGPATH];
AStringHolder tmpPath = new char[MAX_LONGPATH];
if (options.DumpPathTemplate == nullptr)
{
if (GetTempPathWrapper(MAX_LONGPATH, tmpPath) == 0)
Expand Down Expand Up @@ -256,7 +256,7 @@ GetDumpTypeString(DumpType dumpType)
return "unknown";
}
}

MINIDUMP_TYPE
GetMiniDumpType(DumpType dumpType)
{
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/createdump/createdumpwindows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CreateDump(const CreateDumpOptions& options)
_ASSERTE(options.CreateDump);
_ASSERTE(!options.CrashReport);

ArrayHolder<char> pszName = new char[MAX_LONGPATH + 1];
AStringHolder pszName = new char[MAX_LONGPATH + 1];
std::string dumpPath;

// On Windows, createdump is restricted for security reasons to only the .NET process (parent process) that launched createdump
Expand Down Expand Up @@ -63,7 +63,7 @@ CreateDump(const CreateDumpOptions& options)
printf_error("Invalid dump path '%s' - %s\n", dumpPath.c_str(), GetLastErrorString().c_str());
goto exit;
}

int retryCount = 10;
// Retry the write dump on ERROR_PARTIAL_COPY
for (int i = 0; i <= retryCount; i++)
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/createdump/dumpname.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ FormatDumpName(std::string& name, const char* pattern, const char* exename, int

// hostname
case 'h': {
ArrayHolder<char> buffer = new char[MAX_LONGPATH + 1];
AStringHolder buffer = new char[MAX_LONGPATH + 1];
if (gethostname(buffer, MAX_LONGPATH) != 0)
{
printf_error("Could not get the host name for dump name: %d\n",
Expand Down Expand Up @@ -109,7 +109,7 @@ FormatDumpName(std::string& name, const char* pattern, const char* exename, int
// the numeric real UID of dumped process
case 'u':
// thread id that triggered the dump
case 'i':
case 'i':
case 'I':
// pid of dumped process
case 'P':
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/debug/createdump/threadinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ ThreadInfo::UnwindThread(IXCLRDataProcess* pClrDataProcess, ISOSDacInterface* pS
ReleaseHolder<IXCLRDataTypeInstance> pExceptionType;
if (SUCCEEDED(pExceptionValue->GetType(&pExceptionType)))
{
ArrayHolder<WCHAR> typeName = new WCHAR[MAX_LONGPATH + 1];
if (SUCCEEDED(pExceptionType->GetName(0, MAX_LONGPATH, nullptr, typeName.GetPtr())))
WStringHolder typeName = new WCHAR[MAX_LONGPATH + 1];
if (SUCCEEDED(pExceptionType->GetName(0, MAX_LONGPATH, nullptr, typeName)))
{
m_exceptionType = ConvertString(typeName.GetPtr());
m_exceptionType = ConvertString(typeName);
TRACE("Unwind: exception type %s\n", m_exceptionType.c_str());
}
}
Expand Down Expand Up @@ -287,7 +287,7 @@ ThreadInfo::GatherStackFrames(CONTEXT* pContext, IXCLRDataStackWalk* pStackwalk)
}

// Add managed stack frame for the crash info notes
StackFrame frame(moduleAddress, ip, sp, pMethod.Detach(), nativeOffset, token, ilOffset);
StackFrame frame(moduleAddress, ip, sp, pMethod.Extract(), nativeOffset, token, ilOffset);
AddStackFrame(frame);
}

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/daccess/cdac.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class CDAC final
private:
HMODULE m_module;
intptr_t m_cdac_handle;
NonVMComHolder<ICorDebugDataTarget> m_target;
ReleaseHolder<ICorDebugDataTarget> m_target;

// Assumes the legacy impl lives for the lifetime of this class - currently ClrDataAccess, which contains this class
IUnknown* m_legacyImpl;
Expand Down
4 changes: 2 additions & 2 deletions src/coreclr/debug/daccess/daccess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1126,7 +1126,7 @@ SplitName::CdStartField(_In_opt_ PCWSTR fullName,
status = E_INVALIDARG;
goto Fail;
}

if (typeToken == mdTypeDefNil)
{
if (!split->FindType(mod->GetMDImport()))
Expand Down Expand Up @@ -6651,7 +6651,7 @@ CLRDataCreateInstance(REFIID iid,
#endif

// TODO: [cdac] Remove when cDAC deploys with SOS - https://github.com/dotnet/runtime/issues/108720
NonVMComHolder<IUnknown> cdacInterface = nullptr;
ReleaseHolder<IUnknown> cdacInterface = nullptr;
#ifdef CAN_USE_CDAC
CLRConfigNoCache enable = CLRConfigNoCache::Get("ENABLE_CDAC");
if (enable.IsSet())
Expand Down
8 changes: 4 additions & 4 deletions src/coreclr/debug/dbgutil/machoreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <cordebug.h>
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <arrayholder.h>
#include <holder.h>
#include "machoreader.h"

#if TARGET_64BIT
Expand Down Expand Up @@ -72,7 +72,7 @@ TryGetSymbol(ICorDebugDataTarget* dataTarget, uint64_t baseAddress, const char*
}

//--------------------------------------------------------------------
// MachO module
// MachO module
//--------------------------------------------------------------------

MachOModule::MachOModule(MachOReader& reader, mach_vm_address_t baseAddress, std::string* name) :
Expand Down Expand Up @@ -123,7 +123,7 @@ MachOModule::TryLookupSymbol(const char* symbolName, uint64_t* symbolValue)
_ASSERTE(m_nlists != nullptr);
_ASSERTE(m_strtabAddress != 0);

// First, search just the "external" export symbols
// First, search just the "external" export symbols
if (TryLookupSymbol(m_dysymtabCommand->iextdefsym, m_dysymtabCommand->nextdefsym, symbolName, symbolValue))
{
m_reader.Trace("SYM: Found '%s' in external symbols\n", symbolName);
Expand Down Expand Up @@ -379,7 +379,7 @@ MachOReader::EnumerateModules(mach_vm_address_t dyldInfoAddress)
}
void* imageInfosAddress = (void*)dyldInfo.infoArray;
size_t imageInfosSize = dyldInfo.infoArrayCount * sizeof(dyld_image_info);
ArrayHolder<dyld_image_info> imageInfos = new (std::nothrow) dyld_image_info[dyldInfo.infoArrayCount];
NewArrayHolder<dyld_image_info> imageInfos = new (std::nothrow) dyld_image_info[dyldInfo.infoArrayCount];
if (imageInfos == nullptr)
{
Trace("ERROR: Failed to allocate %zu byte image infos\n", imageInfosSize);
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/di/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -842,7 +842,7 @@ HRESULT CordbModule::InitPublicMetaDataFromFile(const WCHAR * pszFullPathName,
return CORDBG_E_MISSING_METADATA;
}

MapViewHolder hMapView = MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0);
MapViewHolder hMapView{ MapViewOfFile(hMap, FILE_MAP_READ, 0, 0, 0) };
if (hMapView == NULL)
{
LOG((LF_CORDB,LL_WARNING, "CM::IM: Couldn't map view of file \"%s\" (GLE=%x)\n", pszFullPathName, GetLastError()));
Expand Down
81 changes: 0 additions & 81 deletions src/coreclr/inc/arrayholder.h

This file was deleted.

Loading
Loading