Skip to content

Commit

Permalink
Add runtime file version to RuntimeInfo (#82648)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mikem8361 authored Feb 25, 2023
1 parent f2f35f9 commit cabaab5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/coreclr/debug/inc/runtimeinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

// The first byte of the index is the count of bytes
typedef unsigned char SYMBOL_INDEX;
#define RUNTIME_INFO_SIGNATURE "DotNetRuntimeInfo"
#define RUNTIME_INFO_SIGNATURE "DotNetRuntimeInfo"
#define RUNTIME_INFO_VERSION 2

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

extern RuntimeInfo DotNetRuntimeInfo;
6 changes: 5 additions & 1 deletion src/coreclr/debug/runtimeinfo/runtimeinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <windows.h>
#include <runtimeinfo.h>
#include <runtime_version.h>

// Runtime information public export
#ifdef HOST_UNIX
Expand All @@ -19,7 +20,7 @@ RuntimeInfo DotNetRuntimeInfo = {
{
RUNTIME_INFO_SIGNATURE
},
1,
RUNTIME_INFO_VERSION,
{
#include <runtimemoduleindex.h>
},
Expand All @@ -29,4 +30,7 @@ RuntimeInfo DotNetRuntimeInfo = {
{
#include <dbimoduleindex.h>
},
{
RuntimeFileMajorVersion, RuntimeFileMinorVersion, RuntimeFileBuildVersion, RuntimeFileRevisionVersion
},
};

0 comments on commit cabaab5

Please sign in to comment.