Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 01e57ba

Browse files
committed
Resolving issue with breakpoints being deleted for all other than newest
files. Added error handling to breakpoints. Updated logging for process and player connection discovery.
1 parent 20daa3b commit 01e57ba

File tree

7 files changed

+1000
-849
lines changed

7 files changed

+1000
-849
lines changed

Changelog.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ Git: https://github.com/Unity-Technologies/vscode-unity-debug
66
Changes
77
-------
88

9+
2.6.6
10+
=====
11+
- Fix duplicate line removing breakpoints.
12+
13+
2.6.5
14+
=====
15+
- Initialize commands on vs code start up time.
16+
17+
2.6.4
18+
=====
19+
- Improve attaching to unity processes. Added support for PS4, Xbox One, and Switch.
20+
921
2.6.3
1022
=====
1123
- Fix regression within attach unity debugger. This is necessary when EditorInstance.json does not exist.

MonoDebug

UnityDebug/Log.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ static Log ()
1919
static string FormatMessage(string message)
2020
{
2121
var time = DateTime.Now.ToString ("HH:mm:ss.ffffff");
22-
return String.Format ("{0}: {1}\n", time, message);
22+
return $"{time}: {message}\n";
2323
}
2424

2525
public static void DebugWrite(string message)
@@ -29,7 +29,7 @@ public static void DebugWrite(string message)
2929
}
3030

3131
public static void Write(string message)
32-
{
32+
{
3333
var formattedMessage = FormatMessage (message);
3434
lock (logPath) {
3535
File.AppendAllText (logPath, formattedMessage);

UnityDebug/UnityAttach.cs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
using System;
22
using MonoDevelop.Debugger.Soft.Unity;
33
using System.Collections.Generic;
4+
using System.IO;
45
using System.Linq;
6+
using System.Reflection;
7+
using System.Runtime.InteropServices;
58
using System.Text.RegularExpressions;
69

710
namespace UnityDebug
@@ -44,13 +47,24 @@ public static IEnumerable<UnityProcessInfo> GetAttachableProcesses(string target
4447
: UnityProcessDiscovery.GetProcessOptions.Players;
4548
}
4649

50+
Log.Write($"Trying to find all {options}");
4751
var processes = UnityProcessDiscovery.GetAttachableProcesses(options);
4852

4953
processes.ForEach(p => Log.Write("Found Unity process: " + p.Name + " (" + p.Id + ")"));
5054

51-
return processId == -1
52-
? processes.Where(p => p.Name.Contains(processName))
53-
: processes.Where(p => p.Name.Contains(processName) && p.Id == processId);
55+
var resProcesses = processId == -1
56+
? processes.Where(p => p.Name.Contains(processName)).ToArray()
57+
: processes.Where(p => p.Name.Contains(processName) && p.Id == processId).ToArray();
58+
59+
if (resProcesses.Length == 0)
60+
{
61+
Log.Write($"Could not find the correct process name: {targetName}");
62+
Log.Write("These are the one that could be found: ");
63+
processes = UnityProcessDiscovery.GetAttachableProcesses();
64+
processes.ForEach(process => Log.Write($"{process.Name} : {process.Id}"));
65+
}
66+
67+
return resProcesses;
5468
}
5569
}
5670
}

0 commit comments

Comments
 (0)