Skip to content

Commit cabaab5

Browse files
author
Mike McLaughlin
authored
Add runtime file version to RuntimeInfo (#82648)
The diagnostic tooling needs the runtime file version for single-file applications to: 1) Build the long name DAC on Windows 2) SOS commands and other tooling need the version to adjust for different runtime behavior
1 parent f2f35f9 commit cabaab5

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/coreclr/debug/inc/runtimeinfo.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
// The first byte of the index is the count of bytes
77
typedef unsigned char SYMBOL_INDEX;
8-
#define RUNTIME_INFO_SIGNATURE "DotNetRuntimeInfo"
8+
#define RUNTIME_INFO_SIGNATURE "DotNetRuntimeInfo"
9+
#define RUNTIME_INFO_VERSION 2
910

1011
// Make sure that if you update this structure
1112
// - You do so in a in a way that it is backwards compatible. For example, only tail append to this.
@@ -14,10 +15,11 @@ typedef unsigned char SYMBOL_INDEX;
1415
typedef struct _RuntimeInfo
1516
{
1617
const char Signature[18];
17-
int Version;
18+
const int Version;
1819
const SYMBOL_INDEX RuntimeModuleIndex[24];
1920
const SYMBOL_INDEX DacModuleIndex[24];
2021
const SYMBOL_INDEX DbiModuleIndex[24];
22+
const int RuntimeVersion[4]; // major, minor, build, revision
2123
} RuntimeInfo;
2224

2325
extern RuntimeInfo DotNetRuntimeInfo;

src/coreclr/debug/runtimeinfo/runtimeinfo.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <windows.h>
1212
#include <runtimeinfo.h>
13+
#include <runtime_version.h>
1314

1415
// Runtime information public export
1516
#ifdef HOST_UNIX
@@ -19,7 +20,7 @@ RuntimeInfo DotNetRuntimeInfo = {
1920
{
2021
RUNTIME_INFO_SIGNATURE
2122
},
22-
1,
23+
RUNTIME_INFO_VERSION,
2324
{
2425
#include <runtimemoduleindex.h>
2526
},
@@ -29,4 +30,7 @@ RuntimeInfo DotNetRuntimeInfo = {
2930
{
3031
#include <dbimoduleindex.h>
3132
},
33+
{
34+
RuntimeFileMajorVersion, RuntimeFileMinorVersion, RuntimeFileBuildVersion, RuntimeFileRevisionVersion
35+
},
3236
};

0 commit comments

Comments
 (0)