try
{
+ // If incoming filePath is not a full path, then check file names only
+ Func<string, bool> FileNameMatches;
+ string fileName = GetFileName(filePath);
+ if (fileName == filePath)
+ FileNameMatches = s => GetFileName(s) == fileName;
+ else
+ FileNameMatches = s => s == filePath;
+
foreach (MethodDebugInformationHandle methodDebugInformationHandle in reader.MethodDebugInformation)
{
MethodDebugInformation methodDebugInfo = reader.GetMethodDebugInformation(methodDebugInformationHandle);
foreach (SequencePoint point in sequencePoints)
{
string sourceName = reader.GetString(reader.GetDocument(point.Document).Name);
- if (point.StartLine == lineNumber && sourceName == filePath)
+ if (point.StartLine == lineNumber && FileNameMatches(sourceName))
{
methodToken = MetadataTokens.GetToken(methodDebugInformationHandle.ToDefinitionHandle());
ilOffset = point.Offset;
auto breakpoints = m_breakpoints.find(sp.document);
if (breakpoints == m_breakpoints.end())
- return E_FAIL;
+ {
+ // try to find a match with file name only
+ breakpoints = m_breakpoints.find(GetFileName(sp.document));
+ if (breakpoints == m_breakpoints.end())
+ return E_FAIL;
+ }
auto &breakpointsInSource = breakpoints->second;
auto it = breakpointsInSource.find(sp.startLine);
return S_OK;
}
- Source source(filename);
-
auto &breakpointsInSource = m_breakpoints[filename];
// Remove old breakpoints