Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c3b9989
Write the managed ilasm PDB to a file beside the output
pcshrosbree Oct 6, 2026
39f0b96
Generate a PDB only when /DEBUG or /PDB is given
pcshrosbree Oct 6, 2026
4c298ff
Assemble the PDB determinism check to its own image in the IL round-t…
pcshrosbree Oct 6, 2026
5fe1654
Split the output writer into a stream-based type in ILAssembler and a…
pcshrosbree Oct 6, 2026
5b403a5
Move the ilasm PDB file tests into ILAssembler.Tests
pcshrosbree Oct 6, 2026
f790795
State when each output stream is used, and pin the writer test pair's…
pcshrosbree Oct 6, 2026
3f6053f
Refuse an output that is a symbolic link to its PDB, and report the t…
pcshrosbree Oct 7, 2026
29bed49
Record the PDB file name for deterministic builds
pcshrosbree Oct 8, 2026
09d4a59
Leave the ilasm README unchanged
pcshrosbree Oct 9, 2026
22a210b
Record the document of each sequence point and encode methods that sp…
pcshrosbree Oct 6, 2026
69f72b1
Register the input file and every named source as a PDB document
pcshrosbree Oct 6, 2026
dbd8159
Write the local signature row id in the sequence-point blob header
pcshrosbree Oct 6, 2026
faad2c3
Check the command line's PDB documents end to end in ILAssembler.Tests
pcshrosbree Oct 7, 2026
5093806
Cite the Portable PDB spec for the MethodDebugInformation document an…
pcshrosbree Oct 9, 2026
f5155e1
Add --pathmap to map source path prefixes in the PDB documents and th…
pcshrosbree Oct 9, 2026
8e01ead
Drop the native-option spelling of --pathmap
pcshrosbree Oct 9, 2026
400e967
Honour explicit local slot indices and open a name scope for each lex…
pcshrosbree Oct 6, 2026
ae35425
Emit LocalScope and LocalVariable rows for named locals
pcshrosbree Oct 7, 2026
3ebc35a
Record sequence points at instruction emission, on the IL source when…
pcshrosbree Oct 6, 2026
5f62a5e
Check implicit sequence points and included files end to end in ILAss…
pcshrosbree Oct 7, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions src/tests/Common/CLRTest.Jit.targets
Original file line number Diff line number Diff line change
Expand Up @@ -430,9 +430,11 @@ for inputAssemblyName in glob.glob("*.dll"):
if not is_managed_debug_assembly(inputAssemblyName):
ilasmSwitches = ilasmSwitches + " -DEBUG"

pdbName = inputAssemblyName.replace('.dll', '.pdb')
# Assemble to an image of its own and hash that image and the PDB that ilasm writes beside it.
pdbCheckAssemblyName = os.path.join("IL-RT", assemblyNameWithoutExtension + ".pdbcheck.dll")
pdbName = os.path.join("IL-RT", assemblyNameWithoutExtension + ".pdbcheck.pdb")

ilasm_args = f'{ilasm_path} -output={pdbName} {ilasmSwitches} {disassemblyName}'
ilasm_args = f'{ilasm_path} -output={pdbCheckAssemblyName} {ilasmSwitches} {disassemblyName}'
print(ilasm_args)
proc = subprocess.Popen(ilasm_args, shell=True)

Expand All @@ -446,9 +448,10 @@ for inputAssemblyName in glob.glob("*.dll"):
print(f"ILASM failed with exit code {proc.returncode}")
sys.exit(1)

imageHash = hash_file(pdbCheckAssemblyName)
hash = hash_file(pdbName)

ilasm_args = f'{ilasm_path} -output={pdbName} {ilasmSwitches} {disassemblyName}'
ilasm_args = f'{ilasm_path} -output={pdbCheckAssemblyName} {ilasmSwitches} {disassemblyName}'
print(ilasm_args)
proc = subprocess.Popen(ilasm_args, shell=True)

Expand All @@ -462,6 +465,10 @@ for inputAssemblyName in glob.glob("*.dll"):
print(f"ILASM failed with exit code {proc.returncode}")
sys.exit(1)

if imageHash != hash_file(pdbCheckAssemblyName):
print("ILASM determinism with -DEBUG failed")
sys.exit(1)

if hash != hash_file(pdbName):
print("ILASM PDB determinism failed")
sys.exit(1)
Expand Down
8 changes: 8 additions & 0 deletions src/tools/ilasm/MANAGED-ILASM-FIXES.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,11 @@
| Security pseudoattributes on unsupported targets | Leaves `DynamicSecurityMethodAttribute` and `SuppressUnmanagedCodeSecurityAttribute` unchanged on targets where no transform is applied. | Reports an invalid target consistently with other recognized pseudoattributes. |
| FieldOffset pseudoattribute ordering with local references | Defers attributes with local member-reference owners or constructors, allowing them to override explicit field offsets or attributes appearing later in the source. | Applies attributes in source order regardless of reference form; explicit field offsets always take precedence. |
| `BackwardBranchOptimization_UsesShortInstructionLimit` | With `/OPTIMIZE`, leaves backward branches long when their short-form displacement is -126, -127, or -128. | Uses the actual short-form displacement and emits a short branch whenever it fits in a signed byte. |
| `ExplicitSlot_OutsideTheSixteenBitRange_IsReportedAndTakesTheNextSlot`, `NextSlot_AfterSlot65535_IsReportedAndTheLocalIsNotDeclared` | Accepts any explicit local slot: `[65536]` and above become slots that no 16-bit local instruction operand can name, and a negative slot other than `[-1]` pads the slot table toward 2^32 entries and does not finish. A local without `[n]` after one at slot 65535 takes slot 65536, which no local instruction can name either, and the PDB records its index as 0. Reads `[4294967295]` as `[-1]`, and a hexadecimal literal of more than 16 digits by its low bits, so `[0x10000000000000000]` is slot 0; neither is reported. | Reports an explicit slot outside 0 to 65535 (other than `[-1]`, which means no explicit slot) and gives the local the next free slot. The range is checked on the literal as written, so a literal too large for 32 bits is reported as well. Reports a local whose next free slot is past 65535 and does not declare it. |
| `BlockWithoutInstructions_HasNoScopeRow`, `MethodWithoutInstructions_HasNoScopeRow` | Writes a LocalScope row of length 0 for a `{ }` block, or a method body, that has no instructions and declares a named local; the Portable PDB specification requires a positive length. | Writes no LocalScope row for a scope without instructions. |
| `NameDeclaredTwiceInOneScope_HasOneVariableRowForTheFirstDeclaration`, `SlotDeclaredTwiceInOneScope_HasOneVariableRowForTheFirstDeclaration`, `NameAndSlotEachDeclaredTwice_ANameWhoseSlotAlreadyHasARowHasNone`, `SlotOfALaterDeclarationOfAName_DoesNotKeepAnotherNameOut` | Writes a LocalVariable row for every named local of a scope, so a scope that declares a name or a slot twice has two rows with that name or index, which the Portable PDB specification does not allow. | Writes a row for each name of a scope at the slot its first declaration has, unless an earlier row of the scope already describes that slot. A name refers to its first declaration in the scope, so a row never describes a local that the name does not refer to. Later declarations of a name, and unnamed locals, take no part: they claim no slot and keep no other name out. |
| `InstructionOnTheLineOfTheLastPointButInAnotherInputFile_GetsAPoint` | Gives an instruction a sequence point only when its lines and columns differ from the last point's, whatever the file: an instruction without a `.line` directive on the line of the last point, in another input file or an `#include`d file, gets no point and is attributed to the previous file. | Also gives the instruction a point when its document differs from the last point's. |
| `LineDirectiveBeforeAnInclude_DoesNotApplyInTheIncludedFile` | After an `#include`d file, makes the including file the current document again while the including file's `.line` coordinates stay in effect, so its next points have the coordinates of the `.line` file in the including file. | Keeps the including file's `.line` directive and its file in effect after the include. |
| `IncludedFileWithoutAPointOfItsOwn_IsNotADocument` | Defines every `#include`d file as a PDB document when it is included, whether or not any sequence point is in it. | Defines an included file as a document when one of its instructions first gets a sequence point in it. |
| `IncludedFile_IsADocumentWithTheLanguageInEffectAtItsFirstPoint` | Gives an included file's document the IL assembly language even when a `.language` directive comes right before the `#include`: it defines the document at the `#include`, before that `.language` has been applied. | Gives the document the language in effect when it is defined, at its first point. |
| `InstructionsFromADefineMacro_AreOnTheLineWhereTheMacroIsUsed` | Reads the text of a `#define` macro as a new source starting at line 1, so an instruction it produces is mapped to line 1 of the document, and all such instructions share one point. | Maps an instruction produced by a macro to the line where the macro is used. |
Loading
Loading