You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The is either a question or a bug report. Basically does the /linenum flag of ILDASM work with .NET Core?
Context: We use ILDASM in the F# repo from package “Microsoft.NETCore.ILDAsm". However I can’t get the “/linenum” option to workm, e.g. to show the PDB file contents in terms of sequence points. We use this to lock down our debugging experience, which is quite important one way or another. I could dump the sequence points from the compiler but it’s really convenient to have them showing with the IL code.
in the statement fInsertSourceLines = g_fInsertSourceLines; under if (g_pSymReader) condition, g_fInsertSourceLines is 1 with /linenum or -linenum argument, otherwise 0; but that statement is unreachable because g_pSymReader is always null in ildasm.
@mirkomaty I made some initial progress like reading the document table, but had to switch to some other higher priority issues.
I will probably get back to this later in November.
If you need assistance earlier, maybe @TIHan or someone from the team, could pick this up sooner.
@ivanpovazan: Thanks a lot for your answer. The problem is not so urgent, because currently I tell my users to use
<DebugType>full</DebugType>
But since .NET Core will be the dominant platform in the future, there is little point in having my users insert that line into their project files all the time.
I'm not able to customize ILDasm myself, so I appreciate you taking the time to do so. ;-) If it happens this year, it is perfect for me. Thanks again.
Unfortunately, I will not have enough cycles to look further into this in the near future. Will remain at disposal if anyone needs help or has questions around this.
I took ILDasm from the package runtime.win-x64.microsoft.netcore.ilasm in the version 8.0.0.0.
Disassembling with Dasm with /LINENUM switch doesn't provide any line numbers regardless of the TargetFramework (netstandard 2.0 or net6.0).
EDIT: Same with v. 9.0.0-preview.3.24172.9
ILDasm from the .NET Fx Tools 4.8 does the trick. It seems, as if the full pdb support has been removed in order to replace it with portable pdb support, which never happened. It would help a lot to get the pdb support back as long as portable pdb is not implemented.
that addressed this particular issue. The update as-is is unlikely to be merged, but if build-it-yourself will solve your problem, you might try it.
There are a number of limitations: most notably, we don't
try to use the Debug_Information table to find the pdb file;
we just look for a file with the same name as the executable
and replace the extension with .pdb.
No effort is made to read the scope/local variable table.
To build ildasm from this branch, from src/coreclr
./build-runtime.sh -component iltools
Activity
JulieLeeMSFT commentedon Jun 16, 2021
@EgorBo PTAL.
am11 commentedon Mar 15, 2022
When ilasm received the support for portable PDB, ildasm was left out #37702 (comment). It is more of a feature request than a bug report. 😄
Note that once portable PDB parser is plugged into ildasm, this condition will start to satisfy:
runtime/src/coreclr/ildasm/dis.cpp
Line 1132 in abb7df5
fInsertSourceLines = g_fInsertSourceLines;underif (g_pSymReader)condition,g_fInsertSourceLinesis 1 with/linenumor-linenumargument, otherwise 0; but that statement is unreachable becauseg_pSymReaderis always null in ildasm.7 remaining items
ivanpovazan commentedon Nov 4, 2022
@mirkomaty I made some initial progress like reading the document table, but had to switch to some other higher priority issues.
I will probably get back to this later in November.
If you need assistance earlier, maybe @TIHan or someone from the team, could pick this up sooner.
mirkomaty commentedon Nov 4, 2022
@ivanpovazan: Thanks a lot for your answer. The problem is not so urgent, because currently I tell my users to use
<DebugType>full</DebugType>But since .NET Core will be the dominant platform in the future, there is little point in having my users insert that line into their project files all the time.
I'm not able to customize ILDasm myself, so I appreciate you taking the time to do so. ;-) If it happens this year, it is perfect for me. Thanks again.
ivanpovazan commentedon Feb 9, 2024
Unfortunately, I will not have enough cycles to look further into this in the near future. Will remain at disposal if anyone needs help or has questions around this.
mirkomaty commentedon May 3, 2024
Hello, is there any progress in this area?
I created a simple project with this project file:
I took ILDasm from the package
runtime.win-x64.microsoft.netcore.ilasmin the version 8.0.0.0.Disassembling with Dasm with /LINENUM switch doesn't provide any line numbers regardless of the TargetFramework (netstandard 2.0 or net6.0).
EDIT: Same with v. 9.0.0-preview.3.24172.9
ILDasm from the .NET Fx Tools 4.8 does the trick. It seems, as if the full pdb support has been removed in order to replace it with portable pdb support, which never happened. It would help a lot to get the pdb support back as long as portable pdb is not implemented.
Use the old ILDasm in order to get the LINENUM issue solved.
Use the old ILDasm in order to get the LINENUM issue solved.
JulieLeeMSFT commentedon Oct 15, 2024
Reassigned to @amanasifkhalid.
antlersoft commentedon Feb 5, 2025
You can find a fork here: https://github.com/antlersoft/runtime/tree/Issue-53822_ildasm_portable_pdb_linenum
that addressed this particular issue. The update as-is is unlikely to be merged, but if build-it-yourself will solve your problem, you might try it.
There are a number of limitations: most notably, we don't
try to use the Debug_Information table to find the pdb file;
we just look for a file with the same name as the executable
and replace the extension with .pdb.
Complete managed ildasm and round-trip test support
Complete managed ildasm and round-trip test support