Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit394a3c2

Browse files
auduchinokKevinRansom
authored andcommitted
Rename pdbPath to pdbDirPath in assembly reading (dotnet#4768)
1 parentb5eaf77 commit394a3c2

File tree

4 files changed

+31
-30
lines changed

4 files changed

+31
-30
lines changed

‎src/absil/ilread.fs‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3281,8 +3281,8 @@ and seekReadTopExportedTypes (ctxt: ILMetadataReader) =
32813281
])
32823282

32833283
#if!FX_NO_PDB_READER
3284-
letgetPdbReaderpdbPath fileName=
3285-
matchpdbPathwith
3284+
letgetPdbReaderpdbDirPath fileName=
3285+
matchpdbDirPathwith
32863286
| None-> None
32873287
| Some pdbpath->
32883288
try
@@ -3694,7 +3694,7 @@ let openMetadataReader (fileName, mdfile: BinaryFile, metadataPhysLoc, peinfo, p
36943694
// read of the AbsIL module.
36953695
// ----------------------------------------------------------------------
36963696

3697-
letopenPEFileReader(fileName,pefile:BinaryFile,pdbPath)=
3697+
letopenPEFileReader(fileName,pefile:BinaryFile,pdbDirPath)=
36983698
letpev= pefile.GetView()
36993699
(* MSDOS HEADER*)
37003700
letpeSignaturePhysLoc= seekReadInt32 pev0x3c
@@ -3861,13 +3861,13 @@ let openPEFileReader (fileName, pefile: BinaryFile, pdbPath) =
38613861
// Set up the PDB reader so we can read debug info for methods.
38623862
// ----------------------------------------------------------------------
38633863
#if FX_NO_PDB_READER
3864-
letpdb= ignorepdbPath; None
3864+
letpdb= ignorepdbDirPath; None
38653865
#else
38663866
letpdb=
38673867
if runningOnMonothen
38683868
None
38693869
else
3870-
getPdbReaderpdbPath fileName
3870+
getPdbReaderpdbDirPath fileName
38713871
#endif
38723872

38733873
letpectxt:PEReader=
@@ -3891,8 +3891,8 @@ let openPEFileReader (fileName, pefile: BinaryFile, pdbPath) =
38913891
letpeinfo=(subsys,(subsysMajor, subsysMinor), useHighEnthropyVA, ilOnly, only32, is32bitpreferred, only64, platform, isDll, alignVirt, alignPhys, imageBaseReal)
38923892
(metadataPhysLoc, metadataSize, peinfo, pectxt, pev, pdb)
38933893

3894-
letopenPE(fileName,pefile,pdbPath,reduceMemoryUsage,ilGlobals)=
3895-
let(metadataPhysLoc,_metadataSize,peinfo,pectxt,pev,pdb)= openPEFileReader(fileName, pefile,pdbPath)
3894+
letopenPE(fileName,pefile,pdbDirPath,reduceMemoryUsage,ilGlobals)=
3895+
let(metadataPhysLoc,_metadataSize,peinfo,pectxt,pev,pdb)= openPEFileReader(fileName, pefile,pdbDirPath)
38963896
letilModule,ilAssemblyRefs= openMetadataReader(fileName, pefile, metadataPhysLoc, peinfo, pectxt, pev, Some pectxt, reduceMemoryUsage, ilGlobals)
38973897
ilModule, ilAssemblyRefs, pdb
38983898

@@ -3919,7 +3919,7 @@ type MetadataOnlyFlag = Yes | No
39193919
typeReduceMemoryFlag= Yes| No
39203920

39213921
typeILReaderOptions=
3922-
{pdbPath:string option
3922+
{pdbDirPath:string option
39233923
ilGlobals:ILGlobals
39243924
reduceMemoryUsage:ReduceMemoryFlag
39253925
metadataOnly:MetadataOnlyFlag
@@ -3969,7 +3969,7 @@ let tryMemoryMapWholeFile opts fileName =
39693969

39703970
letOpenILModuleReaderFromBytes fileName bytes opts=
39713971
letpefile= ByteFile(fileName, bytes):> BinaryFile
3972-
letilModule,ilAssemblyRefs,pdb= openPE(fileName, pefile, opts.pdbPath,(opts.reduceMemoryUsage= ReduceMemoryFlag.Yes), opts.ilGlobals)
3972+
letilModule,ilAssemblyRefs,pdb= openPE(fileName, pefile, opts.pdbDirPath,(opts.reduceMemoryUsage= ReduceMemoryFlag.Yes), opts.ilGlobals)
39733973
new ILModuleReader(ilModule, ilAssemblyRefs,(fun()-> ClosePdbReader pdb))
39743974

39753975
letOpenILModuleReader fileName opts=
@@ -3978,7 +3978,7 @@ let OpenILModuleReader fileName opts =
39783978
try
39793979
letfullPath= FileSystem.GetFullPathShim(fileName)
39803980
letwriteTime= FileSystem.GetLastWriteTimeShim(fileName)
3981-
letkey= ILModuleReaderCacheKey(fullPath, writeTime, opts.ilGlobals.primaryAssemblyScopeRef, opts.pdbPath.IsSome, opts.reduceMemoryUsage, opts.metadataOnly)
3981+
letkey= ILModuleReaderCacheKey(fullPath, writeTime, opts.ilGlobals.primaryAssemblyScopeRef, opts.pdbDirPath.IsSome, opts.reduceMemoryUsage, opts.metadataOnly)
39823982
key,true
39833983
with exn->
39843984
System.Diagnostics.Debug.Assert(false, sprintf"Failed to compute key in OpenILModuleReader cache for '%s'. Falling back to uncached. Error =%s" fileName(exn.ToString()))
@@ -3987,7 +3987,7 @@ let OpenILModuleReader fileName opts =
39873987

39883988
letcacheResult=
39893989
if keyOkthen
3990-
if opts.pdbPath.IsSomethen None// can't used a cached entry when reading PDBs, since it makes the returned object IDisposable
3990+
if opts.pdbDirPath.IsSomethen None// can't used a cached entry when reading PDBs, since it makes the returned object IDisposable
39913991
else ilModuleReaderCacheLock.AcquireLock(fun ltok-> ilModuleReaderCache.TryGet(ltok, key))
39923992
else
39933993
None
@@ -3999,7 +3999,7 @@ let OpenILModuleReader fileName opts =
39993999
letreduceMemoryUsage=(opts.reduceMemoryUsage= ReduceMemoryFlag.Yes)
40004000
letmetadataOnly=(opts.metadataOnly= MetadataOnlyFlag.Yes)
40014001

4002-
if reduceMemoryUsage&& opts.pdbPath.IsNonethen
4002+
if reduceMemoryUsage&& opts.pdbDirPath.IsNonethen
40034003

40044004
// This case is used in FCS applications, devenv.exe and fsi.exe
40054005
//
@@ -4058,11 +4058,11 @@ let OpenILModuleReader fileName opts =
40584058
letdisposer={new IDisposablewithmember__.Dispose()=()}
40594059
disposer, pefile
40604060

4061-
letilModule,ilAssemblyRefs,pdb= openPE(fullPath, pefile, opts.pdbPath, reduceMemoryUsage, opts.ilGlobals)
4061+
letilModule,ilAssemblyRefs,pdb= openPE(fullPath, pefile, opts.pdbDirPath, reduceMemoryUsage, opts.ilGlobals)
40624062
letilModuleReader=new ILModuleReader(ilModule, ilAssemblyRefs,(fun()-> ClosePdbReader pdb))
40634063

40644064
// Readers with PDB reader disposal logic don't go in the cache. Note the PDB reader is only used in static linking.
4065-
if keyOk&& opts.pdbPath.IsNonethen
4065+
if keyOk&& opts.pdbDirPath.IsNonethen
40664066
ilModuleReaderCacheLock.AcquireLock(fun ltok-> ilModuleReaderCache.Put(ltok, key, ilModuleReader))
40674067

40684068
ilModuleReader

‎src/absil/ilread.fsi‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ type internal MetadataOnlyFlag = Yes | No
4444
typeinternalReduceMemoryFlag= Yes| No
4545

4646
typeinternalILReaderOptions=
47-
{pdbPath:string option
47+
{pdbDirPath:string option
4848

4949
ilGlobals:ILGlobals
5050

‎src/fsharp/CompileOps.fs‎

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2626,7 +2626,7 @@ type TcConfigBuilder =
26262626
ri, fileNameOfPath ri, ILResourceAccess.Public
26272627

26282628

2629-
letOpenILBinary(filename,reduceMemoryUsage,ilGlobalsOpt,pdbPathOption,shadowCopyReferences,tryGetMetadataSnapshot)=
2629+
letOpenILBinary(filename,reduceMemoryUsage,ilGlobalsOpt,pdbDirPath,shadowCopyReferences,tryGetMetadataSnapshot)=
26302630
letilGlobals=
26312631
// ILScopeRef.Local can be used only for primary assembly (mscorlib or System.Runtime) itself
26322632
// Remaining assemblies should be opened using existing ilGlobals (so they can properly locate fundamental types)
@@ -2638,7 +2638,7 @@ let OpenILBinary(filename, reduceMemoryUsage, ilGlobalsOpt, pdbPathOption, shado
26382638
{ ilGlobals= ilGlobals
26392639
metadataOnly= MetadataOnlyFlag.Yes
26402640
reduceMemoryUsage= reduceMemoryUsage
2641-
pdbPath=pdbPathOption
2641+
pdbDirPath=pdbDirPath
26422642
tryGetMetadataSnapshot= tryGetMetadataSnapshot}
26432643

26442644
letlocation=
@@ -2700,7 +2700,7 @@ type AssemblyResolution =
27002700
| Some aref-> aref
27012701
| None->
27022702
letreaderSettings:ILReaderOptions=
2703-
{pdbPath=None
2703+
{pdbDirPath=None
27042704
ilGlobals= EcmaMscorlibILGlobals
27052705
reduceMemoryUsage= reduceMemoryUsage
27062706
metadataOnly= MetadataOnlyFlag.Yes
@@ -4061,7 +4061,7 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
40614061
letopts:ILReaderOptions=
40624062
{ ilGlobals= g.ilg
40634063
reduceMemoryUsage= tcConfig.reduceMemoryUsage
4064-
pdbPath= None
4064+
pdbDirPath= None
40654065
metadataOnly= MetadataOnlyFlag.Yes
40664066
tryGetMetadataSnapshot= tcConfig.tryGetMetadataSnapshot}
40674067
letreader= OpenILModuleReaderFromBytes fileName bytes opts
@@ -4132,20 +4132,21 @@ type TcImports(tcConfigP:TcConfigProvider, initialResolutions:TcAssemblyResoluti
41324132
try
41334133
CheckDisposed()
41344134
lettcConfig= tcConfigP.Get(ctok)
4135-
letpdbPathOption=
4135+
letpdbDirPath=
41364136
// We open the pdb file if one exists parallel to the binary we
41374137
// are reading, so that --standalone will preserve debug information.
41384138
if tcConfig.openDebugInformationForLaterStaticLinkingthen
4139-
letpdbDir=(try Filename.directoryName filenamewith_->".")
4140-
letpdbFile=(try Filename.chopExtension filenamewith_-> filename)+".pdb"
4141-
if FileSystem.SafeExists pdbFilethen
4139+
letpdbDir=try Filename.directoryName filenamewith_->"."
4140+
letpdbFile=(try Filename.chopExtension filenamewith_-> filename)+".pdb"
4141+
4142+
if FileSystem.SafeExists(pdbFile)then
41424143
if verbosethen dprintf"reading PDB file%s from directory%s\n" pdbFile pdbDir
41434144
Some pdbDir
4144-
else
4145-
None
4146-
else
4145+
else
4146+
None
4147+
else
41474148
None
4148-
letilILBinaryReader= OpenILBinary(filename, tcConfig.reduceMemoryUsage, ilGlobalsOpt,pdbPathOption, tcConfig.shadowCopyReferences, tcConfig.tryGetMetadataSnapshot)
4149+
letilILBinaryReader= OpenILBinary(filename, tcConfig.reduceMemoryUsage, ilGlobalsOpt,pdbDirPath, tcConfig.shadowCopyReferences, tcConfig.tryGetMetadataSnapshot)
41494150
tcImports.AttachDisposeAction(fun _->(ilILBinaryReader:> IDisposable).Dispose())
41504151
ilILBinaryReader.ILModuleDef, ilILBinaryReader.ILAssemblyRefs
41514152
with e->

‎src/fsharp/fsc.fs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ module StaticLinker =
11641164
reduceMemoryUsage= tcConfig.reduceMemoryUsage
11651165
metadataOnly= MetadataOnlyFlag.No
11661166
tryGetMetadataSnapshot=(fun _-> None)
1167-
pdbPath= None}
1167+
pdbDirPath= None}
11681168
ILBinaryReader.OpenILModuleReader mscorlib40 opts
11691169

11701170
lettdefs1= ilxMainModule.TypeDefs.AsList|> List.filter(fun td->not(MainModuleBuilder.injectedCompatTypes.Contains(td.Name)))
@@ -1250,7 +1250,7 @@ module StaticLinker =
12501250

12511251
letfileName= dllInfo.FileName
12521252
letmodul=
1253-
letpdbPathOption=
1253+
letpdbDirPathOption=
12541254
// We open the pdb file if one exists parallel to the binary we
12551255
// are reading, so that --standalone will preserve debug information.
12561256
if tcConfig.openDebugInformationForLaterStaticLinkingthen
@@ -1268,7 +1268,7 @@ module StaticLinker =
12681268
{ ilGlobals= ilGlobals
12691269
metadataOnly= MetadataOnlyFlag.No// turn this off here as we need the actual IL code
12701270
reduceMemoryUsage= tcConfig.reduceMemoryUsage
1271-
pdbPath=pdbPathOption
1271+
pdbDirPath=pdbDirPathOption
12721272
tryGetMetadataSnapshot=(fun _-> None)}
12731273

12741274
letreader= ILBinaryReader.OpenILModuleReader dllInfo.FileName opts

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp