Commit 7f55b2d
authored
[logcat-parse] Use C# verbatim strings for paths (#927)
`logcat-parse` didn't properly deal with execution on Windows; when
specifying a Windows-style path on Windows:
> cd "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android"
> .\logcat-parse.exe \path\to\my\grefs.txt
var grefs = Grefs.Parse("\path\to\my\grefs.txt");
(1,52): error CS1009: Unrecognized escape sequence `\p'
(1,60): error CS1009: Unrecognized escape sequence `\m'
(1,63): error CS1009: Unrecognized escape sequence `\g'
`logcat-parse` could still be used, but you'd either have to use `/`
instead of `\`, or invoke `logcat-parse` from where `grefs.txt` is:
> cd \path\to\my
> "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\logcat-parse.exe" ^
grefs.txt
// `adb logcat` GREF parsing utility
//
// Use `Grefs.Parse(stream)` to parse a file containing `adb logcat` output.
// Grefs.AllocatedPeers contains all exposed Java.Lang.Object instances.
// Grefs.AlivePeers contains those still alive by the end of parsing.
var grefs = Grefs.Parse("grefs.txt");
Mono C# Shell, type "help;" for help
Enter statements below.
csharp>
Fix `logcat-parse` so that [C# verbatim strings][0] are used:
> "%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise\MSBuild\Xamarin\Android\logcat-parse.exe" ^
\path\to\my\grefs.txt
…
var grefs = Grefs.Parse(@"\path\to\my\grefs.txt");
This allows straightforward usage on Windows.
[0]: https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/#regular-and-verbatim-string-literals1 parent 2601146 commit 7f55b2d
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
| 55 | + | |
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| |||
0 commit comments