Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

R2RDump - Output in XML format #18425

Merged
merged 8 commits into from
Jun 27, 2018
Merged

R2RDump - Output in XML format #18425

merged 8 commits into from
Jun 27, 2018

Conversation

acmyu
Copy link

@acmyu acmyu commented Jun 11, 2018

No description provided.

@acmyu acmyu changed the title R2RDump - Output in XML format WIP R2RDump - Output in XML format Jun 14, 2018
@acmyu acmyu force-pushed the xml branch 2 times, most recently from 6ed924e to a6fb524 Compare June 16, 2018 00:41
@acmyu acmyu requested a review from zacharycmontoya June 18, 2018 18:36
@acmyu acmyu force-pushed the xml branch 2 times, most recently from 64b4c9a to 470f755 Compare June 19, 2018 23:36
@acmyu acmyu changed the title WIP R2RDump - Output in XML format R2RDump - Output in XML format Jun 20, 2018
@acmyu acmyu requested a review from nattress June 20, 2018 17:16
@sergiy-k
Copy link

Thanks @acmyu! LGTM.
@zamont, @nattress, do you have any comments for this change?

@@ -33,8 +34,8 @@ private enum GcInfoHeaderFlags

public struct InterruptibleRange
{
public uint StartOffset { get; }
public uint StopOffset { get; }
public uint StartOffset { get; set; }

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you make all the properties publicly writeable? I thought the idea was they get set as we read each data structure from the image and from then on these should all be immutable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The XmlSerializer required the properties to have a public setter. When it didn't have one, it didn't serialize those properties

NativeParser availableTypesParser = new NativeParser(r2r.Image, availableTypesSectionOffset);
NativeHashtable availableTypes = new NativeHashtable(r2r.Image, availableTypesParser, (uint)(availableTypesSectionOffset + section.Size));
_writer.WriteLine(availableTypes.ToString());
if(!_xml)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The split we have here where we have if(_xml) all over tells me we should refactor into a TextDumper / XmlDumper class. It would be nice if we could just create the right text / xml dumper class when we're parsing the input arguments and save all these ifs. In the future, if we added, say, a JSON emitter mode, it would be a matter of implementing a new set of overrides instead of having to look through all the ifs.

Copy link

@nattress nattress left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a couple comments in line

@acmyu
Copy link
Author

acmyu commented Jun 22, 2018

@dotnet-bot Test this please

}
break;
case R2RSection.SectionType.READYTORUN_SECTION_COMPILER_IDENTIFIER:
AddXMLNode("CompileIdentifier", _r2r.CompileIdentifier, contentsNode);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be "CompilerIdentifier"?

return;
}

_writer.Write(" ");

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you ever expect to hit this code down here? It seems like if a parent node wasn't specified, you wouldn't want to write anything.

@zacharycmontoya
Copy link

LGTM. I left a couple of comments.

Copy link

@nattress nattress left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great - thanks for splitting out the two dumpers!

@acmyu acmyu merged commit 8684550 into dotnet:master Jun 27, 2018
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
R2RDump - Output in XML format

Commit migrated from dotnet/coreclr@8684550
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants