-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[cdac] cdac-build-tool #100650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
[cdac] cdac-build-tool #100650
Changes from 1 commit
Commits
Show all changes
67 commits
Select commit
Hold shift + click to select a range
8518e9f
checkpoint
lambdageek 12aef6d
add old tooling notes
lambdageek 1eff4d0
add an emitter
lambdageek 22e217b
checkpoint read in the directory header
lambdageek dd9279d
checkpoint plausible-looking offsets
lambdageek 492af29
checkpoint: field stuff is working
lambdageek 459d124
checkpoint json
lambdageek 28f8256
contract parsing
lambdageek 418739d
refactor
lambdageek 1c1524d
indirect pointer value support
lambdageek 34e852e
move sample to tool dir
lambdageek e48e709
Take baselines from the docs/design/datacontracts/data dir
lambdageek 0e8c60e
Add README
lambdageek cd4f0f0
fix BE
lambdageek b6b079e
hook up cdac-build-tool to the coreclr build; export DotNetRuntimeCon…
lambdageek a9b0d7f
try fix win-x86 build warning
lambdageek dbf0557
paths
lambdageek 74433f1
vebose
lambdageek ea441b6
fix typo; fixes win32
lambdageek 787b836
cleanup; add contracts.txt
lambdageek e015e83
add diagram to README
lambdageek 0354723
move implementation notes
lambdageek da038f3
better verbose output from ObjectFileScraper
lambdageek f64b548
turn off whole program optimizations for data-descriptor.obj
lambdageek 2e29a10
C++-ify and add real Thread offsets
lambdageek 58162a3
no C99 designated initializers in C++ until C++20
lambdageek 4bb51bf
build data descriptor after core runtime
lambdageek 9700e29
fix gcc build
lambdageek 3f22c7c
fix typo
lambdageek 4aae511
simplify ObjectFileScraper
lambdageek 60738ef
more dependencies
lambdageek c0dab90
try fix source build
lambdageek 84eaa3b
remove fixme; document
lambdageek 86e5258
Merge commit 'origin/main^' into cdac-contract-tool
lambdageek cc658c9
invoke 'dotnet cmake-build-tool.dll' instead of 'dotnet run --project'
lambdageek 39fe70d
clean up macro boilerplate
lambdageek 5064deb
platform flags
lambdageek 74000bc
turn off verbose output
lambdageek 76c27bc
can't use constexpr function in coreclr
lambdageek 270fe21
Code review fixups
lambdageek 84e0800
Rename "aux data" to "pointer data"
lambdageek 51da4e3
rename "data-descriptor" to "datadescriptor"
lambdageek b26f3ac
simplify linking
lambdageek 8f9d1a7
cdac-build-tool don't build dotnet tool; turn on analyzers
lambdageek 87b79b3
update README
lambdageek b33ad07
rationalize naming; update docs; add some inline comments
lambdageek c39e6f4
rm whitespace
lambdageek 5ef8428
renamce cdac.h to cdacoffsets.h
lambdageek 9f381be
comments
lambdageek 443f83b
fixup README
lambdageek 9fc2b26
hex offsets; improved formatting
lambdageek 024c566
don't throw in ParseContracts; add line numbers to errors
lambdageek b0f1f40
spelling
lambdageek 2852d8d
Update README.md
lambdageek 2429bd8
change input format for contracts to jsonc
lambdageek 18a863e
add custom JsonConverter instances for the compact json representation
lambdageek a49e5e6
code review changes
lambdageek 1f5ba44
inline comments into the data-descriptor-blob C code
lambdageek 2decea4
cleanup
lambdageek ce18bee
comments and markdown
lambdageek e143998
Apply suggestions from code review
lambdageek 08cf75d
simplify; bug fix - PointerDataCount include placeholder
lambdageek 0d4d40d
fixup docs
lambdageek 94c56ea
Merge remote-tracking branch 'origin/main' into cdac-contract-tool
lambdageek 3d49b70
Update src/coreclr/tools/cdac-build-tool/JsonConverter/GlobalModelJso…
lambdageek f845c41
one more set of feedback changes
lambdageek 64430cf
maybe no live ILLink ?
lambdageek File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
change input format for contracts to jsonc
- Loading branch information
commit 2429bd81ddd95df86c7befa16c227ba35d4a0b1b
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//algorithmic contracts for coreclr | ||
// The format of this file is: JSON with comments | ||
// { | ||
// "CONTRACT NAME": VERSION, | ||
// ... | ||
// } | ||
// CONTRACT NAME is an arbitrary string, VERSION is an integer | ||
// | ||
// cdac-build-tool can take multiple "-c contract_file" arguments | ||
// so to conditionally include contracts, put additional contracts in a separate file | ||
{ | ||
"SOSBreakingChangeVersion": 1 // example contract: "runtime exports an SOS breaking change version global" | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
src/coreclr/tools/cdac-build-tool/JsonConverter/ContractCollectctionModelJsonConverter.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
using Microsoft.DotNet.Diagnostics.DataContract.BuildTool; | ||
|
||
namespace Microsoft.DotNet.Diagnostics.DataContract.JsonConverter; | ||
|
||
/// <summary> | ||
/// Parses or serializes contracts in the "compact" JSON format: as a single | ||
/// object for the whole collection where each contract name is a property name and | ||
/// the value is the version number. | ||
/// </summary> | ||
public class ContractCollectionModelJsonConverter : JsonConverter<DataDescriptorModel.ContractCollectionModel> | ||
{ | ||
public override DataDescriptorModel.ContractCollectionModel Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) | ||
{ | ||
Dictionary<string, DataDescriptorModel.ContractBuilder> contracts = new(); | ||
if (reader.TokenType != JsonTokenType.StartObject) | ||
{ | ||
throw new JsonException(); | ||
} | ||
while (reader.Read()) | ||
{ | ||
switch (reader.TokenType) | ||
{ | ||
case JsonTokenType.EndObject: | ||
var builtContracts = contracts.Select((kvp) => (kvp.Key, kvp.Value.Build())); | ||
return new DataDescriptorModel.ContractCollectionModel(builtContracts.ToDictionary()); | ||
case JsonTokenType.PropertyName: | ||
string? propertyName = reader.GetString(); | ||
if (propertyName is null) | ||
{ | ||
throw new JsonException(); | ||
} | ||
reader.Read(); | ||
int version = reader.GetInt32(); | ||
contracts.Add(propertyName, new DataDescriptorModel.ContractBuilder { Version = version }); | ||
break; | ||
case JsonTokenType.Comment: | ||
break; | ||
default: | ||
throw new JsonException(); | ||
} | ||
} | ||
throw new JsonException(); | ||
} | ||
|
||
public override void Write(Utf8JsonWriter writer, DataDescriptorModel.ContractCollectionModel value, JsonSerializerOptions options) | ||
{ | ||
writer.WriteStartObject(); | ||
foreach (var (name, contract) in value.Contracts) | ||
{ | ||
writer.WriteNumber(name, contract.Version); | ||
|
||
} | ||
writer.WriteEndObject(); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.