Skip to content

Commit 75adbc7

Browse files
author
Mike McLaughlin
authored
Minor changes to make it easier to sync diagnostic repo copy (#107066)
* Minor changes to make it easier to sync diagnostic repo copy * Undo ELF.h changes.
1 parent f3bab96 commit 75adbc7

File tree

14 files changed

+409
-24
lines changed

14 files changed

+409
-24
lines changed

src/coreclr/gc/gcdesc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,9 @@ class CGCDesc
160160
{
161161
// If it doesn't contain pointers, there isn't a GCDesc
162162
PTR_MethodTable mt(pMT);
163-
163+
#ifndef SOS_INCLUDE
164164
_ASSERTE(mt->ContainsGCPointers());
165-
165+
#endif
166166
return PTR_CGCDesc(mt);
167167
}
168168

src/coreclr/gcdump/gcdump.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
* to the standard code-manager spec.
1111
*/
1212

13-
#ifndef TARGET_UNIX
13+
#if !defined(TARGET_UNIX) && !defined(SOS_INCLUDE)
1414
#include "utilcode.h" // For _ASSERTE()
15-
#endif //!TARGET_UNIX
15+
#endif
1616
#include "gcdump.h"
1717

1818
/*****************************************************************************/

src/coreclr/gcdump/gcdumpnonx86.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ PCSTR GetRegName (UINT32 regnum)
104104
case 29: return "s6";
105105
case 30: return "s7";
106106
case 31: return "s8";
107+
case 32: return "pc";
107108
}
108109

109110
return "???";
@@ -142,6 +143,7 @@ PCSTR GetRegName (UINT32 regnum)
142143
case 29: return "t4";
143144
case 30: return "t5";
144145
case 31: return "t6";
146+
case 32: return "pc";
145147
}
146148

147149
return "???";

src/coreclr/gcdump/i386/gcdumpx86.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#ifdef TARGET_X86
99
/*****************************************************************************/
1010

11-
#ifndef TARGET_UNIX
11+
#if !defined(TARGET_UNIX) && !defined(SOS_INCLUDE)
1212
#include "utilcode.h" // For _ASSERTE()
13-
#endif //!TARGET_UNIX
13+
#endif
1414
#include "gcdump.h"
1515

1616

@@ -834,10 +834,7 @@ size_t GCDump::DumpGCTable(PTR_CBYTE table,
834834

835835
if (callPndTab)
836836
{
837-
#if defined(_DEBUG) && !defined(STRIKE)
838-
// note: _ASSERTE is a no-op for strike
839837
PTR_CBYTE offsStart = table;
840-
#endif
841838
gcPrintf(" argOffs(%d) =", callPndTabCnt);
842839
for (unsigned i=0; i < callPndTabCnt; i++)
843840
{

src/coreclr/gcinfo/gcinfodumper.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#ifndef SOS_INCLUDE
45
#include "common.h"
6+
#endif
57
#include "gcinfodumper.h"
68
#include "gcinfodecoder.h"
79

src/coreclr/inc/arrayholder.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4+
#pragma once
5+
46
template <class T>
57
class ArrayHolder
68
{

src/coreclr/inc/gcinfodumper.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
#include "gcinfodecoder.h"
99

1010
// *****************************************************************************
11-
// WARNING!!!: These values and code are also used by SOS in the diagnostics
12-
// repo. Should updated in a backwards and forwards compatible way.
11+
// WARNING!!!: These values and code are used in the runtime repo and SOS in the
12+
// diagnostics repo. Should updated in a backwards and forwards compatible way.
1313
// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcinfodumper.h
14+
// https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/gcinfodumper.h
1415
// *****************************************************************************
1516

1617
//

src/coreclr/inc/gcinfotypes.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@
1414
#endif // _MSC_VER
1515

1616
// *****************************************************************************
17-
// WARNING!!!: These values and code are also used by SOS in the diagnostics
18-
// repo. Should updated in a backwards and forwards compatible way.
17+
// WARNING!!!: These values and code are used in the runtime repo and SOS in the
18+
// diagnostics repo. Should updated in a backwards and forwards compatible way.
1919
// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/gcinfotypes.h
20+
// https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/gcinfotypes.h
2021
// *****************************************************************************
2122

2223
#define PARTIALLY_INTERRUPTIBLE_GC_SUPPORTED

src/coreclr/inc/holder.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,10 @@ FORCEINLINE void DoTheRelease(TYPE *value)
909909
template<typename _TYPE>
910910
using DoNothingHolder = SpecializedWrapper<_TYPE, DoNothing<_TYPE*>>;
911911

912+
#ifndef SOS_INCLUDE
912913
template<typename _TYPE>
913914
using ReleaseHolder = SpecializedWrapper<_TYPE, DoTheRelease<_TYPE>>;
915+
#endif // SOS_INCLUDE
914916

915917
template<typename _TYPE>
916918
using NonVMComHolder = SpecializedWrapper<_TYPE, DoTheRelease<_TYPE>>;

src/coreclr/inc/metahost.idl

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ cpp_quote("EXTERN_GUID(IID_ICLRDebuggingLibraryProvider, 0x3151c08d, 0x4d09, 0x4
6060
// IID ICLRDebuggingLibraryProvider2 interface : uuid{E04E2FF1-DCFD-45D5-BCD1-16FFF2FAF7BA}
6161
cpp_quote("EXTERN_GUID(IID_ICLRDebuggingLibraryProvider2, 0xE04E2FF1, 0xDCFD, 0x45D5, 0xBC, 0xD1, 0x16, 0xFF, 0xF2, 0xFA, 0xF7, 0xBA);")
6262

63+
// IID ICLRDebuggingLibraryProvider3 interface : uuid{DE3AAB18-46A0-48B4-BF0D-2C336E69EA1B}
64+
cpp_quote("EXTERN_GUID(IID_ICLRDebuggingLibraryProvider3, 0xde3aab18, 0x46a0, 0x48b4, 0xbf, 0xd, 0x2c, 0x33, 0x6e, 0x69, 0xea, 0x1b);")
65+
6366
// For use in ICLRMetaHost::RequestRuntimeLoadedNotification
6467
interface ICLRRuntimeInfo;
6568

@@ -71,6 +74,13 @@ typedef void (__stdcall *RuntimeLoadedCallbackFnPtr)(
7174
CallbackThreadSetFnPtr pfnCallbackThreadSet,
7275
CallbackThreadUnsetFnPtr pfnCallbackThreadUnset);
7376

77+
typedef enum
78+
{
79+
UnknownIndex = 0,
80+
Identity = 1,
81+
Runtime = 2,
82+
} LIBRARY_PROVIDER_INDEX_TYPE;
83+
7484
/**************************************************************************************
7585
** ICLRMetaHost **
7686
** Activated using mscoree!CLRCreateInstance. Does not do any policy decisions, get **
@@ -290,6 +300,104 @@ interface ICLRDebuggingLibraryProvider2 : IUnknown
290300
[out] LPWSTR* ppResolvedModulePath);
291301
}
292302

303+
/**************************************************************************************
304+
** ICLRDebuggingLibraryProvider3 **
305+
** Implemented by API user **
306+
** This interface allows the debugger to provide module paths which are needed for **
307+
** debugging a particular CLR such as mscordbi and mscordacwks. **
308+
**************************************************************************************/
309+
[
310+
uuid(DE3AAB18-46A0-48B4-BF0D-2C336E69EA1B),
311+
version(1.0),
312+
helpstring("CLR debugging LibraryProvider callback interface"),
313+
local
314+
]
315+
interface ICLRDebuggingLibraryProvider3 : IUnknown
316+
{
317+
/**********************************************************************************
318+
** The goal of this method is to allow the debugger to provide a module path **
319+
** which is needed for debugging. The debugger may use any available means to **
320+
** locate and/or procure the module. See the security note below for important **
321+
** information about implementing this method securely. **
322+
** Arguments: **
323+
** pwzFileName - The name of the module being requested **
324+
** **
325+
** pwszRuntimeModule - The runtime module path or the module path of the **
326+
** single-file app. NULL when called from the **
327+
** OpenVirtualProcess API. **
328+
** **
329+
** indexType - The type of time stamp/file size is either the identity of the **
330+
** requested module or the runtime (coreclr) module's. **
331+
** **
332+
** dwTimeStamp - The date time stamp stored in the COFF file header of PE files **
333+
** **
334+
** dwSizeOfImage - The SizeOfImage field stored in the COFF optional file header **
335+
** of PE files **
336+
** **
337+
** ppResolvedModulePath - Where *ppResolvedModulePath is a null terminated **
338+
** path to the module dll. On Windows it should be **
339+
** allocated with CoTaskMemAlloc. On Unix it should be **
340+
** allocated with malloc. Failure leave it untouched. See **
341+
** security note below! **
342+
** **
343+
** Return value - S_OK if the module was provided, or any other convenient **
344+
** error HRESULT if the module could not be provided **
345+
** **
346+
** !!!!!!!!!!!!!! **
347+
** SECURITY NOTE: Anything the caller would not be willing to execute itself, it **
348+
** should not provide to the this API call **
349+
***********************************************************************************/
350+
HRESULT ProvideWindowsLibrary(
351+
[in] const WCHAR* pwszFileName,
352+
[in] const WCHAR* pwszRuntimeModule,
353+
[in] LIBRARY_PROVIDER_INDEX_TYPE indexType,
354+
[in] DWORD dwTimestamp,
355+
[in] DWORD dwSizeOfImage,
356+
[out] LPWSTR* ppResolvedModulePath);
357+
358+
/**********************************************************************************
359+
** The goal of this method is to allow the debugger to provide a module path **
360+
** which is needed for debugging. The debugger may use any available means to **
361+
** locate and/or procure the module. See the security note below for important **
362+
** information about implementing this method securely. **
363+
** Arguments: **
364+
** pwszFileName - The name of the module being requested **
365+
** **
366+
** pwszRuntimeModule - The runtime module path or the module path of the **
367+
** single-file app. NULL when called from the **
368+
** OpenVirtualProcess API. **
369+
** **
370+
** indexType - The type of the build id either the identity of the requested **
371+
** module or the runtime (coreclr) module's. Normally it will **
372+
** be the identity index type and the runtime index for Linux **
373+
** cross-DAC on Windows or for non-singlefile apps on Linux/MacOS. **
374+
** **
375+
** pbBuildId - The Linux or MacOS module build id **
376+
** **
377+
** iBuildIdSize - The number of bytes in the build id **
378+
** **
379+
** ppResolvedModulePath - Where *ppResolvedModulePath is a null terminated **
380+
** path to the module dll. On Windows it should be **
381+
** allocated with CoTaskMemAlloc. On Unix it should be **
382+
** allocated with malloc. Failure leave it untouched. See **
383+
** security note below! **
384+
** **
385+
** Return value - S_OK if the module was provided, or any other convenient **
386+
** error HRESULT if the module could not be provided **
387+
** **
388+
** !!!!!!!!!!!!!! **
389+
** SECURITY NOTE: Anything the caller would not be willing to execute itself, it **
390+
** should not provide to the this API call **
391+
***********************************************************************************/
392+
HRESULT ProvideUnixLibrary(
393+
[in] const WCHAR* pwszFileName,
394+
[in] const WCHAR* pwszRuntimeModule,
395+
[in] LIBRARY_PROVIDER_INDEX_TYPE indexType,
396+
[in] BYTE* pbBuildId,
397+
[in] int iBuildIdSize,
398+
[out] LPWSTR* ppResolvedModulePath);
399+
}
400+
293401
/**************************************************************************************
294402
** ICLRDebugging **
295403
** Activated using mscoree!CLRCreateInstance. **

src/coreclr/inc/stresslog.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,10 @@
1717
extension (eg. strike). There is no memory allocation system calls etc to purtub things */
1818

1919
// ******************************************************************************
20-
// WARNING!!!: These classes are used by SOS in the diagnostics repo. Values should
21-
// added or removed in a backwards and forwards compatible way.
20+
// WARNING!!!: These classes are used by the runtime and SOS in the diagnostics
21+
// repo. Values should added or removed in a backwards and forwards compatible way.
2222
// See: https://github.com/dotnet/diagnostics/blob/main/src/shared/inc/stresslog.h
23+
// https://github.com/dotnet/runtime/blob/main/src/coreclr/inc/stresslog.h
2324
// Parser: https://github.com/dotnet/diagnostics/blob/main/src/SOS/Strike/stressLogDump.cpp
2425
// ******************************************************************************
2526

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
2+
3+
/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
4+
5+
/* link this file in with the server and any clients */
6+
7+
8+
/* File created by MIDL compiler version 8.01.0628 */
9+
/* Compiler settings for metahost.idl:
10+
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.01.0628
11+
protocol : dce , ms_ext, c_ext, robust
12+
error checks: allocation ref bounds_check enum stub_data
13+
VC __declspec() decoration level:
14+
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
15+
DECLSPEC_UUID(), MIDL_INTERFACE()
16+
*/
17+
/* @@MIDL_FILE_HEADING( ) */
18+
19+
#pragma warning( disable: 4049 ) /* more than 64k source lines */
20+
21+
22+
#ifdef __cplusplus
23+
extern "C"{
24+
#endif
25+
26+
27+
#include <rpc.h>
28+
#include <rpcndr.h>
29+
30+
#ifdef _MIDL_USE_GUIDDEF_
31+
32+
#ifndef INITGUID
33+
#define INITGUID
34+
#include <guiddef.h>
35+
#undef INITGUID
36+
#else
37+
#include <guiddef.h>
38+
#endif
39+
40+
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
41+
DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
42+
43+
#else // !_MIDL_USE_GUIDDEF_
44+
45+
#ifndef __IID_DEFINED__
46+
#define __IID_DEFINED__
47+
48+
typedef struct _IID
49+
{
50+
unsigned long x;
51+
unsigned short s1;
52+
unsigned short s2;
53+
unsigned char c[8];
54+
} IID;
55+
56+
#endif // __IID_DEFINED__
57+
58+
#ifndef CLSID_DEFINED
59+
#define CLSID_DEFINED
60+
typedef IID CLSID;
61+
#endif // CLSID_DEFINED
62+
63+
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
64+
EXTERN_C __declspec(selectany) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
65+
66+
#endif // !_MIDL_USE_GUIDDEF_
67+
68+
MIDL_DEFINE_GUID(IID, IID_ICLRMetaHost,0xD332DB9E,0xB9B3,0x4125,0x82,0x07,0xA1,0x48,0x84,0xF5,0x32,0x16);
69+
70+
71+
MIDL_DEFINE_GUID(IID, IID_ICLRDebuggingLibraryProvider,0x3151C08D,0x4D09,0x4f9b,0x88,0x38,0x28,0x80,0xBF,0x18,0xFE,0x51);
72+
73+
74+
MIDL_DEFINE_GUID(IID, IID_ICLRDebuggingLibraryProvider2,0xE04E2FF1,0xDCFD,0x45D5,0xBC,0xD1,0x16,0xFF,0xF2,0xFA,0xF7,0xBA);
75+
76+
77+
MIDL_DEFINE_GUID(IID, IID_ICLRDebuggingLibraryProvider3,0xDE3AAB18,0x46A0,0x48B4,0xBF,0x0D,0x2C,0x33,0x6E,0x69,0xEA,0x1B);
78+
79+
80+
MIDL_DEFINE_GUID(IID, IID_ICLRDebugging,0xD28F3C5A,0x9634,0x4206,0xA5,0x09,0x47,0x75,0x52,0xEE,0xFB,0x10);
81+
82+
83+
MIDL_DEFINE_GUID(IID, IID_ICLRRuntimeInfo,0xBD39D1D2,0xBA2F,0x486a,0x89,0xB0,0xB4,0xB0,0xCB,0x46,0x68,0x91);
84+
85+
#undef MIDL_DEFINE_GUID
86+
87+
#ifdef __cplusplus
88+
}
89+
#endif
90+
91+
92+

0 commit comments

Comments
 (0)