[Lldb-commits] [PATCH] D33426: Introduce new command: thread unique-stacks

Jim Ingham via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon May 22 18:09:15 PDT 2017


jingham requested changes to this revision.
jingham added a comment.
This revision now requires changes to proceed.

The idea is great.  I think it is a little confusing that you would do:

(lldb) thread backtrace all

to get all threads but

  (lldb) thread unique-stacks

to backtrace the unique stacks.  Wouldn't it be more logical to do:

  (lldb) thread backtrace unique

It's really just another specification of the threads you are backtracing.

A few inline comments, we use '_' word separators for locals.



================
Comment at: source/Commands/CommandObjectThread.cpp:344
+
+    std::vector<UniqueStack> uniqueStacks;
+    Process *process = m_exe_ctx.GetProcessPtr();
----------------
uniqueStacks -> unique_stacks


================
Comment at: source/Commands/CommandObjectThread.cpp:384-385
+    // Grab each frame's address
+    std::stack<Address> stackFrames;
+    const uint32_t frameCount = thread->GetStackFrameCount();
+    for (uint32_t frameIndex = 0; frameIndex < frameCount; frameIndex++)
----------------
We do local variables as: word_other_word, not camel-case.


================
Comment at: source/Commands/CommandObjectThread.cpp:393
+    // Try to match the threads stack to and existing thread.
+    bool foundMatch = false;
+    for (UniqueStack& uniqueStack : uniqueStacks)
----------------
found_match


https://reviews.llvm.org/D33426





More information about the lldb-commits mailing list