-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Source Link support for Portable PDB symbols (#131)
Add support for browser Source Link navigation in CIL View
- Loading branch information
1 parent
3f4fbef
commit db8778e
Showing
9 changed files
with
288 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* CIL Tools | ||
* Copyright (c) 2022, MSDN.WhiteKnight (https://github.com/MSDN-WhiteKnight) | ||
* License: BSD 2.0 */ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
|
||
namespace CilView.SourceCode | ||
{ | ||
public class SourceLinkEntry | ||
{ | ||
public string SymbolsPath { get; set; } | ||
public string ServerPath { get; set; } | ||
|
||
public string GetServerPath(string symbolsPath) | ||
{ | ||
if (this.SymbolsPath.EndsWith("*", StringComparison.Ordinal)) | ||
{ | ||
//wildcard | ||
string matchPrefix = this.SymbolsPath.Substring(0, this.SymbolsPath.Length - 1); | ||
|
||
if (symbolsPath.StartsWith(matchPrefix, StringComparison.OrdinalIgnoreCase)) | ||
{ | ||
if(matchPrefix.Length >= symbolsPath.Length) return string.Empty; | ||
|
||
string symbolsPathSuffix = symbolsPath.Substring(matchPrefix.Length); | ||
string mappedPath = this.ServerPath.Replace("*", symbolsPathSuffix); | ||
mappedPath = mappedPath.Replace("\\", "/"); | ||
return mappedPath; | ||
} | ||
else | ||
{ | ||
return string.Empty; | ||
} | ||
} | ||
else | ||
{ | ||
//exact | ||
if (this.SymbolsPath.Equals(symbolsPath, StringComparison.Ordinal)) | ||
{ | ||
return this.ServerPath; | ||
} | ||
else | ||
{ | ||
return string.Empty; | ||
} | ||
} | ||
} | ||
} | ||
} |
Oops, something went wrong.