Clean up the stop printing header lines.
I added a "thread-stop-format" to distinguish between the form
that is just the thread info (since the stop printing immediately prints
the frame info) and one with more frame 0 info - which is useful for
"thread list" and the like.
I also added a frame.no-debug boolean to the format entities so you can
print frame information differently between frames with source info and those
without.
This closes https://reviews.llvm.org/D26383.
<rdar://problem/28273697>
llvm-svn: 286288
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 10678ec..8e2a9c7 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -1769,7 +1769,8 @@
return Error();
}
-void Thread::DumpUsingSettingsFormat(Stream &strm, uint32_t frame_idx) {
+void Thread::DumpUsingSettingsFormat(Stream &strm, uint32_t frame_idx,
+ bool stop_format) {
ExecutionContext exe_ctx(shared_from_this());
Process *process = exe_ctx.GetProcessPtr();
if (process == nullptr)
@@ -1785,8 +1786,12 @@
}
}
- const FormatEntity::Entry *thread_format =
- exe_ctx.GetTargetRef().GetDebugger().GetThreadFormat();
+ const FormatEntity::Entry *thread_format;
+ if (stop_format)
+ thread_format = exe_ctx.GetTargetRef().GetDebugger().GetThreadStopFormat();
+ else
+ thread_format = exe_ctx.GetTargetRef().GetDebugger().GetThreadFormat();
+
assert(thread_format);
FormatEntity::Format(*thread_format, strm, frame_sp ? &frame_sc : nullptr,
@@ -1876,7 +1881,8 @@
}
size_t Thread::GetStatus(Stream &strm, uint32_t start_frame,
- uint32_t num_frames, uint32_t num_frames_with_source) {
+ uint32_t num_frames, uint32_t num_frames_with_source,
+ bool stop_format) {
ExecutionContext exe_ctx(shared_from_this());
Target *target = exe_ctx.GetTargetPtr();
Process *process = exe_ctx.GetProcessPtr();
@@ -1900,7 +1906,7 @@
}
}
- DumpUsingSettingsFormat(strm, start_frame);
+ DumpUsingSettingsFormat(strm, start_frame, stop_format);
if (num_frames > 0) {
strm.IndentMore();
@@ -1926,7 +1932,8 @@
bool Thread::GetDescription(Stream &strm, lldb::DescriptionLevel level,
bool print_json_thread, bool print_json_stopinfo) {
- DumpUsingSettingsFormat(strm, 0);
+ const bool stop_format = false;
+ DumpUsingSettingsFormat(strm, 0, stop_format);
strm.Printf("\n");
StructuredData::ObjectSP thread_info = GetExtendedInfo();