Skip to content
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

Remove unused System.Reflection.Emit leftovers #57069

Merged
merged 1 commit into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -1672,88 +1672,4 @@ internal void EnsureCapacity()
internal const int InitialSize = 16;
internal LocalSymInfo?[] m_localSymInfos = null!; // keep track debugging local information
}

/// <summary>
/// This class tracks the line number info
/// </summary>
internal sealed class REDocument
{
internal REDocument(ISymbolDocumentWriter document)
{
// initialize data variables
m_iLineNumberCount = 0;
m_document = document;
}

internal void AddLineNumberInfo(
ISymbolDocumentWriter? document,
int iOffset,
int iStartLine,
int iStartColumn,
int iEndLine,
int iEndColumn)
{
Debug.Assert(document == m_document, "Bad document look up!");

// make sure that arrays are large enough to hold addition info
EnsureCapacity();

m_iOffsets[m_iLineNumberCount] = iOffset;
m_iLines[m_iLineNumberCount] = iStartLine;
m_iColumns[m_iLineNumberCount] = iStartColumn;
m_iEndLines[m_iLineNumberCount] = iEndLine;
m_iEndColumns[m_iLineNumberCount] = iEndColumn;
checked { m_iLineNumberCount++; }
}

/// <summary>
/// Helper to ensure arrays are large enough
/// </summary>
private void EnsureCapacity()
{
if (m_iLineNumberCount == 0)
{
// First time. Allocate the arrays.
m_iOffsets = new int[InitialSize];
m_iLines = new int[InitialSize];
m_iColumns = new int[InitialSize];
m_iEndLines = new int[InitialSize];
m_iEndColumns = new int[InitialSize];
}
else if (m_iLineNumberCount == m_iOffsets.Length)
{
// the arrays are full. Enlarge the arrays
// It would probably be simpler to just use Lists here
int newSize = checked(m_iLineNumberCount * 2);
int[] temp = new int[newSize];
Array.Copy(m_iOffsets, temp, m_iLineNumberCount);
m_iOffsets = temp;

temp = new int[newSize];
Array.Copy(m_iLines, temp, m_iLineNumberCount);
m_iLines = temp;

temp = new int[newSize];
Array.Copy(m_iColumns, temp, m_iLineNumberCount);
m_iColumns = temp;

temp = new int[newSize];
Array.Copy(m_iEndLines, temp, m_iLineNumberCount);
m_iEndLines = temp;

temp = new int[newSize];
Array.Copy(m_iEndColumns, temp, m_iLineNumberCount);
m_iEndColumns = temp;
}
}

private int[] m_iOffsets = null!; // array of offsets
private int[] m_iLines = null!; // array of offsets
private int[] m_iColumns = null!; // array of offsets
private int[] m_iEndLines = null!; // array of offsets
private int[] m_iEndColumns = null!; // array of offsets
internal ISymbolDocumentWriter m_document; // The ISymbolDocumentWriter that this REDocument is tracking.
private int m_iLineNumberCount; // how many entries in the arrays are occupied
private const int InitialSize = 16;
} // end of REDocument
}
1 change: 0 additions & 1 deletion src/coreclr/debug/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
add_subdirectory(daccess)
add_subdirectory(ildbsymlib)
add_subdirectory(ee)
add_subdirectory(di)
add_subdirectory(shim)
Expand Down
18 changes: 1 addition & 17 deletions src/coreclr/debug/daccess/dacdbiimpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4383,23 +4383,7 @@ void DacDbiInterfaceImpl::GetSymbolsBuffer(VMPTR_Module vmModule, TargetBuffer *
}
InitTargetBufferFromMemoryRange(m, pTargetBuffer);

// Set the symbol format appropriately
ESymbolFormat symFormat = pModule->GetInMemorySymbolStreamFormat();
switch (symFormat)
{
case eSymbolFormatPDB:
*pSymbolFormat = kSymbolFormatPDB;
break;

case eSymbolFormatILDB:
*pSymbolFormat = kSymbolFormatILDB;
break;

default:
CONSISTENCY_CHECK_MSGF(false, "Unexpected symbol format");
pTargetBuffer->Clear();
ThrowHR(E_UNEXPECTED);
}
*pSymbolFormat = kSymbolFormatPDB;
}


Expand Down
8 changes: 0 additions & 8 deletions src/coreclr/debug/di/module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include "winbase.h"
#include "corpriv.h"
#include "corsym.h"
#include "ildbsymlib.h"

#include "pedecoder.h"
#include "stgpool.h"
Expand Down Expand Up @@ -2577,13 +2576,6 @@ HRESULT CordbModule::CreateReaderForInMemorySymbols(REFIID riid, void** ppObj)
(void**)&pBinder));
#endif
}
else if (symFormat == IDacDbiInterface::kSymbolFormatILDB)
{
// ILDB format - use statically linked-in ildbsymlib
IfFailThrow(IldbSymbolsCreateInstance(CLSID_CorSymBinder_SxS,
IID_ISymUnmanagedBinder,
(void**)&pBinder));
}
else
{
// No in-memory symbols, return the appropriate error
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/debug/ee/debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9712,7 +9712,7 @@ void Debugger::SendRawUpdateModuleSymsEvent(Module *pRuntimeModule, AppDomain *p
// callback. That callback is defined to pass a PDB stream, and so we still use this
// only for legacy compatibility reasons when we've actually got PDB symbols.
// New clients know they must request a new symbol reader after ClassLoad events.
if (pRuntimeModule->GetInMemorySymbolStreamFormat() != eSymbolFormatPDB)
if (pRuntimeModule->GetInMemorySymbolStream() == NULL)
return; // Non-PDB symbols

DebuggerModule* module = LookupOrCreateModule(pRuntimeModule, pAppDomain);
Expand Down
15 changes: 0 additions & 15 deletions src/coreclr/debug/ildbsymlib/CMakeLists.txt

This file was deleted.

94 changes: 0 additions & 94 deletions src/coreclr/debug/ildbsymlib/classfactory.h

This file was deleted.

Loading