diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 0796a99f3..4bffc5e1f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -21,10 +21,12 @@ "ms-vscode.powershell", "jmrog.vscode-nuget-package-manager" ], - "postCreateCommand": "", - "build": { - "dockerfile": "Dockerfile" - } + "image":"mcr.microsoft.com/vscode/devcontainers/dotnet:6.0-focal", + "remoteUser": "root" + // "postCreateCommand": "", + // "build": { + // "dockerfile": "Dockerfile" + // } } // Built with ❤ by [Pipeline Foundation](https://pipeline.foundation) diff --git a/src/MIDebugEngine/Engine.Impl/DebuggedThread.cs b/src/MIDebugEngine/Engine.Impl/DebuggedThread.cs index ff739b61e..75ffd3de8 100644 --- a/src/MIDebugEngine/Engine.Impl/DebuggedThread.cs +++ b/src/MIDebugEngine/Engine.Impl/DebuggedThread.cs @@ -44,7 +44,7 @@ internal class ThreadCache private List _deadThreads; private List _newThreads; private Dictionary> _threadGroups; - private static uint s_targetId = uint.MaxValue; + private static uint s_targetId = 0; // Thread ids should be start at 0 in the default scenario private const string c_defaultGroupId = "i1"; // gdb's default group id, also used for any process without group ids private List DeadThreads @@ -212,7 +212,7 @@ internal async Task ThreadCreatedEvent(int id, string groupId) Results results = await _debugger.MICommandFactory.ThreadInfo(tid); if (results.ResultClass != ResultClass.done) { - // This can happen on some versions of gdb where thread-info is not supported while running, so only assert if we're also not running. + // This can happen on some versions of gdb where thread-info is not supported while running, so only assert if we're also not running. if (this._debugger.ProcessState != ProcessState.Running) { Debug.Fail("Thread info not successful"); @@ -368,9 +368,19 @@ private bool TryGetTidFromTargetId(string targetId, out uint tid) // In gdb coredumps the thread name is in the form:" LWP " return true; } + else if (targetId.StartsWith("pid ", StringComparison.OrdinalIgnoreCase)) + { + // In QNX gdb coredumps the thread name is in the form:"pid tid ", eg "pid 4194373 tid 308" + int tid_pos = targetId.IndexOf("tid ", StringComparison.Ordinal); + int len = targetId.Length - (tid_pos + 4); + if (len > 0 && System.UInt32.TryParse(targetId.Substring(tid_pos + 4, len), out tid) && tid != 0) + { + return true; + } + } else { - tid = --s_targetId; + tid = ++s_targetId; return true; } @@ -417,7 +427,7 @@ private async Task CollectThreadsInfo(int cxtThreadId) { var tlist = threadsinfo.Find("threads"); - // update our thread list + // update our thread list lock (_threadList) { foreach (var thread in _threadList)