-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added parsing support for the QNX platform Coredump's thread ids format and fixed VSCODE .devcontainer compilation failure #1398
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,7 +44,7 @@ internal class ThreadCache | |
private List<DebuggedThread> _deadThreads; | ||
private List<DebuggedThread> _newThreads; | ||
private Dictionary<string, List<int>> _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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you talk about why you changed this part? Unfortunately there are no comments to say for sure, but I think the idea of starting with This code was added in commit 12632f3280da94787c009c8a97accbe797ac6994, but the author didn't add any more details, and I am sure the author no longer remembers. |
||
private const string c_defaultGroupId = "i1"; // gdb's default group id, also used for any process without group ids | ||
|
||
private List<DebuggedThread> 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 <thread-id>" | ||
return true; | ||
} | ||
else if (targetId.StartsWith("pid ", StringComparison.OrdinalIgnoreCase)) | ||
{ | ||
// In QNX gdb coredumps the thread name is in the form:"pid <pid> tid <pid>", eg "pid 4194373 tid 308" | ||
int tid_pos = targetId.IndexOf("tid ", StringComparison.Ordinal); | ||
int len = targetId.Length - (tid_pos + 4); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to put the rest of this block in |
||
if (len > 0 && System.UInt32.TryParse(targetId.Substring(tid_pos + 4, len), out tid) && tid != 0) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: Use a constant for Example:
|
||
{ | ||
return true; | ||
} | ||
} | ||
else | ||
{ | ||
tid = --s_targetId; | ||
tid = ++s_targetId; | ||
return true; | ||
} | ||
|
||
|
@@ -417,7 +427,7 @@ private async Task<ThreadContext> CollectThreadsInfo(int cxtThreadId) | |
{ | ||
var tlist = threadsinfo.Find<ValueListValue>("threads"); | ||
|
||
// update our thread list | ||
// update our thread list | ||
lock (_threadList) | ||
{ | ||
foreach (var thread in _threadList) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please just delete the commented out code