diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp --- a/lldb/source/Commands/CommandObjectThread.cpp +++ b/lldb/source/Commands/CommandObjectThread.cpp @@ -2187,9 +2187,9 @@ result.AppendError("invalid thread\n"); return false; } - result.AppendMessageWithFormatv("json = {0}, pretty_json = {1}, file = {2}", + result.AppendMessageWithFormatv("json = {0}, pretty_json = {1}, file = {2}, thread = {3}", m_options.m_json, m_options.m_pretty_json, - m_options.m_output_file); + !!m_options.m_output_file, thread_sp->GetID()); return true; } diff --git a/lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py b/lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py new file mode 100644 --- /dev/null +++ b/lldb/test/API/commands/trace/TestTraceDumpFunctionCalls.py @@ -0,0 +1,17 @@ +from intelpt_testcase import * +from lldbsuite.test.lldbtest import * +from lldbsuite.test.decorators import * + +class TestTraceDumpInfo(TraceIntelPTTestCaseBase): + def testDumpFunctionCalls(self): + self.expect("trace load -v " + + os.path.join(self.getSourceDir(), "intelpt-trace", "trace.json")) + + self.expect("thread trace dump function-calls 2", + error=True, substrs=['error: no thread with index: "2"']) + + self.expect("thread trace dump function-calls 1 -j", + substrs=['json = true, pretty_json = false, file = false, thread = 3842849']) + + self.expect("thread trace dump function-calls 1 -F /tmp -J", + substrs=['false, pretty_json = true, file = true, thread = 3842849'])