Skip to content

Commit

Permalink
Remove mentions of Rotor from codebase (dotnet#20298)
Browse files Browse the repository at this point in the history
* Moving parsing from TypeNameParser ctor to a separate method.

It seems a bit odd to have the constructor parsing and then use
a dummy method (MakeRotorHappy) to make it look more normal.

* Remove CorMarkThreadInThreadPool.

It is neither referenced nor exported.

* Remove reference to rotor from securitywrapper.h

* Remove reference to rotor from Strike/vm.cpp.

This file is only built for Windows.

* Remove reference to rotor from debugreturn.h

This is the only file the defines these macros, so there is no need to
undef them first.

* Remove unused code refering to rotor from PAL.

* Remove references to Rotor from PAL.

* Remove references to deleted tests from DisabledTests.txt

I can't find any evidence that this file is actually used.

* Remove unneeded casts.

* Remove dead and misleading code from profilinghelper.cpp.

FEATURE_PROFAPI_EVENT_LOGGING is always defined when PROFILING_SUPPORTED
is defined. And the entire contents of profilinghelper.cpp is surrounded
with "ifdef PROFILING_SUPPORTED". So all sections in
"ifndef FEATURE_PROFAPI_EVENT_LOGGING" are dead.

Furthermore, in coreclr this does not use the eventlog, so the macro name
is misleading.

* Remove dead code in excep.cpp.

This entire function is surrounded with "ifndef FEATURE_PAL".

* Remove refererences to rotor from safemath.h

This does not appear to cause any compile problems, so nobody was using
safemath.h without _ASSERTE defined.

Also S_SIZE_T_WP64BUG is not used anywhere.

* Remove dead code from palclr.h.

I don't know why these check to see if the macro is undefined immediately
after defining them.

Also the comment appears to reference some unions that are no longer in
this file.

* Expose ISymUnmanagedWriter2 from SymWriter as required by COM.

The comment talks about the C# compiler using this, however I cannot see
a way for the C# compiler to get an instance of this. It is only used
internally by AssemblyBuilder and not exposed otherwise.

* Restore check for _ASSERTE in safemath.h.

On Windows sometimes that this file is included without
_ASSERTE being defined. As the existing comment suggests, it appears
that SOS explicitly does not want _ASSERTE to do anything.
  • Loading branch information
AustinWise authored and jkotas committed Oct 9, 2018
1 parent 913428d commit 3f40e52
Show file tree
Hide file tree
Showing 22 changed files with 44 additions and 398 deletions.
28 changes: 4 additions & 24 deletions src/ToolBox/SOS/Strike/vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

// ==++==
//

//
// ==--==
/*++
Module Name:
Expand All @@ -22,7 +17,10 @@ Revision History:
--*/

#ifndef FEATURE_PAL
#ifdef FEATURE_PAL
#error This file is Win32 only.
#endif // #ifdef FEATURE_PAL

#include <tchar.h>


Expand Down Expand Up @@ -712,21 +710,3 @@ Return Value:
}

} // DECLARE_API( vmmap )

#else

#include <rotor_pal.h>
#include <assert.h>

void vmstat()
{
assert(false);
}

void vmmap()
{

assert(false);
}

#endif // #ifndef FEATURE_PAL
3 changes: 2 additions & 1 deletion src/debug/ee/rcthread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@

#include "stdafx.h"


#ifndef FEATURE_PAL
#include "securitywrapper.h"
#endif
#include <aclapi.h>
#include <hosting.h>

Expand Down
3 changes: 0 additions & 3 deletions src/debug/ildbsymlib/symwrite.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,8 @@ COM_METHOD SymWriter::QueryInterface(REFIID riid, void **ppInterface)

if (riid == IID_ISymUnmanagedWriter )
*ppInterface = (ISymUnmanagedWriter*)this;
/* ROTORTODO: Pretend that we do not implement ISymUnmanagedWriter2 to prevent C# compiler from using it.
This is against COM rules since ISymUnmanagedWriter3 inherits from ISymUnmanagedWriter2.
else if (riid == IID_ISymUnmanagedWriter2 )
*ppInterface = (ISymUnmanagedWriter2*)this;
*/
else if (riid == IID_ISymUnmanagedWriter3 )
*ppInterface = (ISymUnmanagedWriter3*)this;
else if (riid == IID_IUnknown)
Expand Down
1 change: 0 additions & 1 deletion src/inc/MSCOREE.IDL
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ cpp_quote("EXTERN_GUID(IID_ITypeNameFactory, 0xB81FF171, 0x20F3, 0x11d2, 0x8d, 0
#pragma midl_echo("DEPRECATED_CLR_STDAPI CorBindToRuntime(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);")
#pragma midl_echo("DEPRECATED_CLR_STDAPI CorBindToCurrentRuntime(LPCWSTR pwszFileName, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);")
#pragma midl_echo("DEPRECATED_CLR_STDAPI ClrCreateManagedInstance(LPCWSTR pTypeName, REFIID riid, void **ppObject);")
#pragma midl_echo("DECLARE_DEPRECATED void STDMETHODCALLTYPE CorMarkThreadInThreadPool();")
#pragma midl_echo("DEPRECATED_CLR_STDAPI RunDll32ShimW(HWND hwnd, HINSTANCE hinst, LPCWSTR lpszCmdLine, int nCmdShow);")
#pragma midl_echo("DEPRECATED_CLR_STDAPI LoadLibraryShim(LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE *phModDll);")
#pragma midl_echo("DEPRECATED_CLR_STDAPI CallFunctionShim(LPCWSTR szDllName, LPCSTR szFunctionName, LPVOID lpvArgument1, LPVOID lpvArgument2, LPCWSTR szVersion, LPVOID pvReserved);")
Expand Down
4 changes: 0 additions & 4 deletions src/inc/debugreturn.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ typedef __SafeToReturn __ReturnOK;
#define DEBUG_ASSURE_NO_RETURN_BEGIN(arg) { typedef __YouCannotUseAReturnStatementHere __ReturnOK; if (0 && __ReturnOK::used()) { } else {
#define DEBUG_ASSURE_NO_RETURN_END(arg) } }

// rotor_pal.h defaulted these to empty macros; this file redefines them
#undef DEBUG_OK_TO_RETURN_BEGIN
#undef DEBUG_OK_TO_RETURN_END

#define DEBUG_OK_TO_RETURN_BEGIN(arg) { typedef __SafeToReturn __ReturnOK; if (0 && __ReturnOK::used()) { } else {
#define DEBUG_OK_TO_RETURN_END(arg) } }

Expand Down
14 changes: 0 additions & 14 deletions src/inc/palclr.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,31 +141,17 @@
#define IMAGE_IMPORT_DESC_FIELD(img, f) ((img).f)
#endif

//Remove these "unanonymous" unions from newer builds for now. Confirm that they were never needed when we
//bring back Rotor.
#define IMAGE_RDE_ID(img) ((img)->Id)
#ifndef IMAGE_RDE_ID
#define IMAGE_RDE_ID(img) ((img)->Id)
#endif

#define IMAGE_RDE_NAME(img) ((img)->Name)
#ifndef IMAGE_RDE_NAME
#define IMAGE_RDE_NAME(img) ((img)->Name)
#endif

#define IMAGE_RDE_OFFSET(img) ((img)->OffsetToData)
#ifndef IMAGE_RDE_OFFSET
#define IMAGE_RDE_OFFSET(img) ((img)->OffsetToData)
#endif

#ifndef IMAGE_RDE_NAME_FIELD
#define IMAGE_RDE_NAME_FIELD(img, f) ((img)->f)
#endif

#define IMAGE_RDE_OFFSET_FIELD(img, f) ((img)->f)
#ifndef IMAGE_RDE_OFFSET_FIELD
#define IMAGE_RDE_OFFSET_FIELD(img, f) ((img)->f)
#endif

#ifndef IMAGE_FE64_FIELD
#define IMAGE_FE64_FIELD(img, f) ((img).f)
Expand Down
16 changes: 1 addition & 15 deletions src/inc/safemath.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#define _ASSERTE_SAFEMATH _ASSERTE
#else
// Otherwise (eg. we're being used from a tool like SOS) there isn't much
// we can rely on that is both available everywhere and rotor-safe. In
// we can rely on that is available everywhere. In
// several other tools we just take the recourse of disabling asserts,
// we'll do the same here.
// Ideally we'd have a collection of common utilities available evererywhere.
Expand Down Expand Up @@ -855,18 +855,4 @@ typedef ClrSafeInt<UINT16> S_UINT16;
typedef ClrSafeInt<UINT64> S_UINT64;
typedef ClrSafeInt<SIZE_T> S_SIZE_T;

// Note: we can get bogus /Wp64 compiler warnings when S_SIZE_T is used.
// This is due to VSWhidbey 138322 which the C++ folks have said they can't
// currently fix. We can work around the problem by using this macro to force
// a no-op cast on 32-bit MSVC platforms. It's not yet clear why we need to
// use this in some places (specifically, rotor lkgvc builds) and not others.
// We also make the error less likely by using a #define instead of a
// typedef for S_UINT32 above since that means we're less likely to instantiate
// ClrSafeInt<UINT32> AND ClrSafeInt<SIZE_T> in the same compliation unit.
#if defined(_TARGET_X86_) && defined( _MSC_VER )
#define S_SIZE_T_WP64BUG(v) S_SIZE_T( static_cast<UINT32>( v ) )
#else
#define S_SIZE_T_WP64BUG(v) S_SIZE_T( v )
#endif

#endif // SAFEMATH_H_
14 changes: 3 additions & 11 deletions src/inc/securitywrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
#ifndef _SECURITY_WRAPPER_H
#define _SECURITY_WRAPPER_H

// This file should not even be included on Rotor.
#ifdef FEATURE_PAL
#error This file should not be included on non-Windows platforms.
#endif

//-----------------------------------------------------------------------------
// Wrapper around a PSID.
Expand Down Expand Up @@ -60,8 +62,6 @@ class SidBuffer
BYTE * m_pBuffer;
};

#ifndef FEATURE_PAL

//-----------------------------------------------------------------------------
// Access Control List.
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -99,13 +99,5 @@ class Win32SecurityDescriptor
PSECURITY_DESCRIPTOR m_pDesc;
};

#endif // FEATURE_PAL

//-----------------------------------------------------------------------------
// Check if the handle owner belongs to either the process specified by the pid
// or the current process. This lets us know if the handle is spoofed.
//-----------------------------------------------------------------------------
bool IsHandleSpoofed(HANDLE handle, DWORD pid);


#endif // _SECURITY_WRAPPER_H
10 changes: 0 additions & 10 deletions src/inc/switches.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,16 +145,6 @@

#endif // _DEBUG



#if defined(PROFILING_SUPPORTED)
// On desktop CLR builds, the profiling API uses the event log for end-user-friendly
// diagnostic messages. CoreCLR on Windows ouputs debug strings for diagnostic messages.
// Rotor builds have no access to event log message resources, though, so they simply
// display popup dialogs for now.
#define FEATURE_PROFAPI_EVENT_LOGGING
#endif // defined(PROFILING_SUPPORTED)

// MUST NEVER CHECK IN WITH THIS ENABLED.
// This is just for convenience in doing performance investigations in a checked-out enlistment.
// #define FEATURE_ENABLE_NO_RANGE_CHECKS
Expand Down
33 changes: 0 additions & 33 deletions src/pal/inc/rt/common.ver

This file was deleted.

54 changes: 0 additions & 54 deletions src/pal/inc/rt/palrt.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,60 +151,6 @@ inline void *__cdecl operator new(size_t, void *_P)

#include <pal_assert.h>

#if defined(_DEBUG)
#define ROTOR_PAL_CTOR_TEST_BODY(TESTNAME) \
class TESTNAME ## _CTOR_TEST { \
public: \
class HelperClass { \
public: \
HelperClass(const char *String) { \
_ASSERTE (m_s == NULL); \
m_s = String; \
} \
\
void Validate (const char *String) { \
_ASSERTE (m_s); \
_ASSERTE (m_s == String); \
_ASSERTE (!strncmp ( \
m_s, \
String, \
1000)); \
} \
\
private: \
const char *m_s; \
}; \
\
TESTNAME ## _CTOR_TEST() { \
_ASSERTE (m_This == NULL); \
m_This = this; \
} \
\
void Validate () { \
_ASSERTE (m_This == this); \
m_String.Validate(#TESTNAME "_CTOR_TEST"); \
} \
\
private: \
void *m_This; \
static HelperClass m_String; \
}; \
\
static TESTNAME ## _CTOR_TEST \
g_ ## TESTNAME ## _CTOR_TEST; \
TESTNAME ## _CTOR_TEST::HelperClass \
TESTNAME ## _CTOR_TEST::m_String(#TESTNAME "_CTOR_TEST");

#define ROTOR_PAL_CTOR_TEST_RUN(TESTNAME) \
g_ ## TESTNAME ##_CTOR_TEST.Validate()

#else // DEBUG

#define ROTOR_PAL_CTOR_TEST_BODY(TESTNAME)
#define ROTOR_PAL_CTOR_TEST_RUN(TESTNAME) do {} while (0)

#endif // DEBUG

#define NTAPI __cdecl
#define WINAPI __cdecl
#define CALLBACK __cdecl
Expand Down
10 changes: 5 additions & 5 deletions src/pal/inc/rt/vsassert.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,18 @@ do { \
#define VSAlloc(cb) HeapAlloc(GetProcessHeap(), 0, cb)
#define VSAllocZero(cb) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, cb)
#define VSRealloc(pv, cb) HeapReAlloc(GetProcessHeap(), 0, pv, cb)
#define VSReallocZero(pv,cb) Rotors_pal_doesnt_have_vsrealloczero
#define VSReallocZero(pv,cb) CoreCLR_pal_doesnt_have_vsrealloczero
#define VSFree(pv) HeapFree(GetProcessHeap(), 0, pv)
#define VSSize(pv) Rotors_pal_doesnt_have_heapsize
#define VSSize(pv) CoreCLR_pal_doesnt_have_heapsize

#define VsDebAlloc(flags,cb) VSAlloc(cb)
#define VsDebRealloc(pv,flags,cb) VSRealloc(pv,cb)
#define VsDebSafeRealloc(pv,flags,cb) Rotors_pal_doenst_have_saferealloc
#define VsDebSafeRealloc(pv,flags,cb) CoreCLR_pal_doenst_have_saferealloc
#define VsDebFree(pv) VSFree(pv)
#define VsDebHeapSize(heap, pv) VSSize(pv)

#define VsDebHeapCreate(flags, name) Rotor_doesnt_have_heapcreate
#define VsDebHeapDestroy(heap, fLeakCheck) Rotor_doesnt_have_heapdestroy
#define VsDebHeapCreate(flags, name) CoreCLR_doesnt_have_heapcreate
#define VsDebHeapDestroy(heap, fLeakCheck) CoreCLR_doesnt_have_heapdestroy

#define VsDebugAllocInternal(hheap,dwFlags,cb,pszFile,uLine,dwInst,pszExtra) \
HeapAlloc(GetProcessHeap(), dwFlags, cb)
Expand Down
1 change: 0 additions & 1 deletion src/pal/prebuilt/inc/mscoree.h
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,6 @@ DEPRECATED_CLR_STDAPI CorBindToRuntimeByCfg(IStream* pCfgStream, DWORD reserved,
DEPRECATED_CLR_STDAPI CorBindToRuntime(LPCWSTR pwszVersion, LPCWSTR pwszBuildFlavor, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);
DEPRECATED_CLR_STDAPI CorBindToCurrentRuntime(LPCWSTR pwszFileName, REFCLSID rclsid, REFIID riid, LPVOID FAR *ppv);
DEPRECATED_CLR_STDAPI ClrCreateManagedInstance(LPCWSTR pTypeName, REFIID riid, void **ppObject);
DECLARE_DEPRECATED void STDMETHODCALLTYPE CorMarkThreadInThreadPool();
DEPRECATED_CLR_STDAPI RunDll32ShimW(HWND hwnd, HINSTANCE hinst, LPCWSTR lpszCmdLine, int nCmdShow);
DEPRECATED_CLR_STDAPI LoadLibraryShim(LPCWSTR szDllName, LPCWSTR szVersion, LPVOID pvReserved, HMODULE *phModDll);
DEPRECATED_CLR_STDAPI CallFunctionShim(LPCWSTR szDllName, LPCSTR szFunctionName, LPVOID lpvArgument1, LPVOID lpvArgument2, LPCWSTR szVersion, LPVOID pvReserved);
Expand Down
39 changes: 0 additions & 39 deletions src/pal/src/include/pal/dtraceprotocol.h

This file was deleted.

Loading

0 comments on commit 3f40e52

Please sign in to comment.