summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2016-11-08 20:36:40 +0000
committerJim Ingham <jingham@apple.com>2016-11-08 20:36:40 +0000
commit6a9767c7e6983c3211e35757899fb83afb2eb807 (patch)
treed3d4fc44de0827c79099978569ee676feb81c604
parentedc183e4375ab9b5be5487035327ca14ab7c322b (diff)
downloadbcm5719-llvm-6a9767c7e6983c3211e35757899fb83afb2eb807.tar.gz
bcm5719-llvm-6a9767c7e6983c3211e35757899fb83afb2eb807.zip
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
-rw-r--r--lldb/include/lldb/API/SBThread.h2
-rw-r--r--lldb/include/lldb/Core/Debugger.h2
-rw-r--r--lldb/include/lldb/Core/FormatEntity.h1
-rw-r--r--lldb/include/lldb/Target/Process.h3
-rw-r--r--lldb/include/lldb/Target/Thread.h10
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py8
-rw-r--r--lldb/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py32
-rw-r--r--lldb/scripts/interface/SBThread.i9
-rw-r--r--lldb/source/API/SBThread.cpp9
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp3
-rw-r--r--lldb/source/Commands/CommandObjectProcess.cpp3
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp3
-rw-r--r--lldb/source/Commands/CommandObjectThread.cpp8
-rw-r--r--lldb/source/Core/Debugger.cpp28
-rw-r--r--lldb/source/Core/FormatEntity.cpp11
-rw-r--r--lldb/source/Target/Process.cpp10
-rw-r--r--lldb/source/Target/Thread.cpp19
-rwxr-xr-xlldb/www/formats.html1
18 files changed, 126 insertions, 36 deletions
diff --git a/lldb/include/lldb/API/SBThread.h b/lldb/include/lldb/API/SBThread.h
index 7162eacb529..502e5c973ef 100644
--- a/lldb/include/lldb/API/SBThread.h
+++ b/lldb/include/lldb/API/SBThread.h
@@ -176,6 +176,8 @@ public:
bool GetDescription(lldb::SBStream &description) const;
+ bool GetDescription(lldb::SBStream &description, bool stop_format) const;
+
bool GetStatus(lldb::SBStream &status) const;
SBThread GetExtendedBacktraceThread(const char *type);
diff --git a/lldb/include/lldb/Core/Debugger.h b/lldb/include/lldb/Core/Debugger.h
index b6dfb507863..b1f8a739150 100644
--- a/lldb/include/lldb/Core/Debugger.h
+++ b/lldb/include/lldb/Core/Debugger.h
@@ -218,6 +218,8 @@ public:
const FormatEntity::Entry *GetThreadFormat() const;
+ const FormatEntity::Entry *GetThreadStopFormat() const;
+
lldb::ScriptLanguage GetScriptLanguage() const;
bool SetScriptLanguage(lldb::ScriptLanguage script_lang);
diff --git a/lldb/include/lldb/Core/FormatEntity.h b/lldb/include/lldb/Core/FormatEntity.h
index d4d616fb75e..564bd5c1125 100644
--- a/lldb/include/lldb/Core/FormatEntity.h
+++ b/lldb/include/lldb/Core/FormatEntity.h
@@ -62,6 +62,7 @@ public:
File,
Lang,
FrameIndex,
+ FrameNoDebug,
FrameRegisterPC,
FrameRegisterSP,
FrameRegisterFP,
diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h
index 737304d86ca..f2add84aac9 100644
--- a/lldb/include/lldb/Target/Process.h
+++ b/lldb/include/lldb/Target/Process.h
@@ -1508,7 +1508,8 @@ public:
size_t GetThreadStatus(Stream &ostrm, bool only_threads_with_stop_reason,
uint32_t start_frame, uint32_t num_frames,
- uint32_t num_frames_with_source);
+ uint32_t num_frames_with_source,
+ bool stop_format);
void SendAsyncInterrupt();
diff --git a/lldb/include/lldb/Target/Thread.h b/lldb/include/lldb/Target/Thread.h
index 632a617453d..63449bbf930 100644
--- a/lldb/include/lldb/Target/Thread.h
+++ b/lldb/include/lldb/Target/Thread.h
@@ -499,8 +499,11 @@ public:
// thread for all memory threads each time we stop.
}
- void DumpUsingSettingsFormat(Stream &strm, uint32_t frame_idx);
-
+ // If stop_format is true, this will be the form used when we print stop info.
+ // If false, it will be the form we use for thread list and co.
+ void DumpUsingSettingsFormat(Stream &strm, uint32_t frame_idx,
+ bool stop_format);
+
bool GetDescription(Stream &s, lldb::DescriptionLevel level,
bool print_json_thread, bool print_json_stopinfo);
@@ -1150,7 +1153,8 @@ public:
GetStackFrameSPForStackFramePtr(StackFrame *stack_frame_ptr);
size_t GetStatus(Stream &strm, uint32_t start_frame, uint32_t num_frames,
- uint32_t num_frames_with_source);
+ uint32_t num_frames_with_source,
+ bool stop_format);
size_t GetStackFrameStatus(Stream &strm, uint32_t first_frame,
uint32_t num_frames, bool show_frame_info,
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
index aadd664dff5..9f55f64b2be 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/completion/TestCompletion.py
@@ -190,8 +190,8 @@ class CommandLineCompletionTestCase(TestBase):
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_set_th(self):
- """Test that 'settings set th' completes to 'settings set thread-format'."""
- self.complete_from_to('settings set th', 'settings set thread-format')
+ """Test that 'settings set thread-f' completes to 'settings set thread-format'."""
+ self.complete_from_to('settings set thread-f', 'settings set thread-format')
@expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@@ -204,9 +204,9 @@ class CommandLineCompletionTestCase(TestBase):
@skipIfFreeBSD # timing out on the FreeBSD buildbot
@no_debug_info_test
def test_settings_clear_th(self):
- """Test that 'settings clear th' completes to 'settings clear thread-format'."""
+ """Test that 'settings clear thread-f' completes to 'settings clear thread-format'."""
self.complete_from_to(
- 'settings clear th',
+ 'settings clear thread-f',
'settings clear thread-format')
@expectedFailureAll(hostoslist=["windows"], bugnumber="llvm.org/pr24679")
diff --git a/lldb/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py b/lldb/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
index 604249e14cf..937ac927001 100644
--- a/lldb/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
+++ b/lldb/packages/Python/lldbsuite/test/functionalities/embedded_interpreter/TestConvenienceVariables.py
@@ -72,21 +72,37 @@ class ConvenienceVariablesCase(TestBase):
self.expect(child.before, exe=False, patterns=[
'SBProcess: pid = \d+, state = stopped, threads = \d, executable = a.out'])
- child.sendline('print(lldb.thread)')
+ child.sendline('print(lldb.thread.GetStopDescription(100))')
child.expect_exact(python_prompt)
- # Linux outputs decimal tid and 'name' instead of 'queue'
self.expect(
child.before,
exe=False,
patterns=[
- 'thread #1: tid = (0x[0-9a-f]+|[0-9]+), 0x[0-9a-f]+ a\.out`main\(argc=1, argv=0x[0-9a-f]+\) \+ \d+ at main\.c:%d, (name|queue) = \'.+\', stop reason = breakpoint 1\.1' %
- self.line])
+ 'breakpoint 1\.1'])
- child.sendline('print(lldb.frame)')
+ child.sendline('lldb.frame.GetLineEntry().GetLine()')
child.expect_exact(python_prompt)
+ line_number = "%d"%(self.line)
self.expect(
child.before,
exe=False,
- patterns=[
- 'frame #0: 0x[0-9a-f]+ a\.out`main\(argc=1, argv=0x[0-9a-f]+\) \+ \d+ at main\.c:%d' %
- self.line])
+ substrs=[
+ line_number])
+
+ child.sendline('lldb.frame.GetLineEntry().GetFileSpec().GetFilename()')
+ child.expect_exact(python_prompt)
+ line_number = "%d"%(self.line)
+ self.expect(
+ child.before,
+ exe=False,
+ substrs=[
+ "main.c"])
+
+ child.sendline('lldb.frame.GetFunctionName()')
+ child.expect_exact(python_prompt)
+ line_number = "%d"%(self.line)
+ self.expect(
+ child.before,
+ exe=False,
+ substrs=[
+ "main"])
diff --git a/lldb/scripts/interface/SBThread.i b/lldb/scripts/interface/SBThread.i
index f8a59f3cd8a..9aacb4374dc 100644
--- a/lldb/scripts/interface/SBThread.i
+++ b/lldb/scripts/interface/SBThread.i
@@ -323,6 +323,15 @@ public:
bool
GetDescription (lldb::SBStream &description) const;
+ %feature("docstring", "
+ //--------------------------------------------------------------------------
+ /// Get the description strings for this thread that match what the
+ /// lldb driver will present, using the thread-format (stop_format==false)
+ /// or thread-stop-format (stop_format = true).
+ //--------------------------------------------------------------------------
+ ") GetDescription;
+ bool GetDescription(lldb::SBStream &description, bool stop_format) const;
+
bool
GetStatus (lldb::SBStream &status) const;
diff --git a/lldb/source/API/SBThread.cpp b/lldb/source/API/SBThread.cpp
index c9dba37b078..fbde6dd3268 100644
--- a/lldb/source/API/SBThread.cpp
+++ b/lldb/source/API/SBThread.cpp
@@ -1328,7 +1328,7 @@ bool SBThread::GetStatus(SBStream &status) const {
ExecutionContext exe_ctx(m_opaque_sp.get(), lock);
if (exe_ctx.HasThreadScope()) {
- exe_ctx.GetThreadPtr()->GetStatus(strm, 0, 1, 1);
+ exe_ctx.GetThreadPtr()->GetStatus(strm, 0, 1, 1, true);
} else
strm.PutCString("No status");
@@ -1336,6 +1336,10 @@ bool SBThread::GetStatus(SBStream &status) const {
}
bool SBThread::GetDescription(SBStream &description) const {
+ return GetDescription(description, false);
+}
+
+bool SBThread::GetDescription(SBStream &description, bool stop_format) const {
Stream &strm = description.ref();
std::unique_lock<std::recursive_mutex> lock;
@@ -1343,7 +1347,8 @@ bool SBThread::GetDescription(SBStream &description) const {
if (exe_ctx.HasThreadScope()) {
exe_ctx.GetThreadPtr()->DumpUsingSettingsFormat(strm,
- LLDB_INVALID_THREAD_ID);
+ LLDB_INVALID_THREAD_ID,
+ stop_format);
// strm.Printf("SBThread: tid = 0x%4.4" PRIx64,
// exe_ctx.GetThreadPtr()->GetID());
} else
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index 6914b2a4917..8f9f60ecd49 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -1672,8 +1672,9 @@ protected:
HistoryThreads thread_list = memory_history->GetHistoryThreads(addr);
+ const bool stop_format = false;
for (auto thread : thread_list) {
- thread->GetStatus(*output_stream, 0, UINT32_MAX, 0);
+ thread->GetStatus(*output_stream, 0, UINT32_MAX, 0, stop_format);
}
result.SetStatus(eReturnStatusSuccessFinishResult);
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index cc38959e03c..ef927d81db7 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -1352,9 +1352,10 @@ public:
const uint32_t start_frame = 0;
const uint32_t num_frames = 1;
const uint32_t num_frames_with_source = 1;
+ const bool stop_format = true;
process->GetStatus(strm);
process->GetThreadStatus(strm, only_threads_with_stop_reason, start_frame,
- num_frames, num_frames_with_source);
+ num_frames, num_frames_with_source, stop_format);
return result.Succeeded();
}
};
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 9cd82c28d63..e6b917b0c6a 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -107,10 +107,11 @@ static void DumpTargetInfo(uint32_t target_idx, Target *target,
const uint32_t start_frame = 0;
const uint32_t num_frames = 1;
const uint32_t num_frames_with_source = 1;
+ const bool stop_format = false;
process_sp->GetStatus(strm);
process_sp->GetThreadStatus(strm, only_threads_with_stop_reason,
start_frame, num_frames,
- num_frames_with_source);
+ num_frames_with_source, stop_format);
}
}
diff --git a/lldb/source/Commands/CommandObjectThread.cpp b/lldb/source/Commands/CommandObjectThread.cpp
index 41416d36f8e..97f78458156 100644
--- a/lldb/source/Commands/CommandObjectThread.cpp
+++ b/lldb/source/Commands/CommandObjectThread.cpp
@@ -248,9 +248,11 @@ protected:
thread->shared_from_this(), type);
if (ext_thread_sp && ext_thread_sp->IsValid()) {
const uint32_t num_frames_with_source = 0;
+ const bool stop_format = false;
if (ext_thread_sp->GetStatus(strm, m_options.m_start,
m_options.m_count,
- num_frames_with_source)) {
+ num_frames_with_source,
+ stop_format)) {
DoExtendedBacktrace(ext_thread_sp.get(), result);
}
}
@@ -277,7 +279,7 @@ protected:
const uint32_t num_frames_with_source = 0;
if (!thread->GetStatus(strm, m_options.m_start, m_options.m_count,
- num_frames_with_source)) {
+ num_frames_with_source, false)) {
result.AppendErrorWithFormat(
"error displaying backtrace for thread: \"0x%4.4x\"\n",
thread->GetIndexID());
@@ -1308,7 +1310,7 @@ protected:
const uint32_t num_frames_with_source = 0;
process->GetStatus(strm);
process->GetThreadStatus(strm, only_threads_with_stop_reason, start_frame,
- num_frames, num_frames_with_source);
+ num_frames, num_frames_with_source, false);
return result.Succeeded();
}
};
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 96461f80446..1577a38f336 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -97,7 +97,8 @@ OptionEnumValueElement g_language_enumerators[] = {
#define MODULE_WITH_FUNC \
"{ " \
- "${module.file.basename}{`${function.name-with-args}${function.pc-offset}}}"
+ "${module.file.basename}{`${function.name-with-args}" \
+ "{${frame.no-debug}${function.pc-offset}}}}"
#define FILE_AND_LINE "{ at ${line.file.basename}:${line.number}}"
#define IS_OPTIMIZED "{${function.is-optimized} [opt]}"
@@ -113,8 +114,18 @@ OptionEnumValueElement g_language_enumerators[] = {
"{\\nCompleted expression: ${thread.completed-expression}}" \
"\\n"
+#define DEFAULT_THREAD_STOP_FORMAT \
+ "thread #${thread.index}{, name = '${thread.name}'}" \
+ "{, queue = '${thread.queue}'}" \
+ "{, activity = '${thread.info.activity.name}'}" \
+ "{, ${thread.info.trace_messages} messages}" \
+ "{, stop reason = ${thread.stop-reason}}" \
+ "{\\nReturn value: ${thread.return-value}}" \
+ "{\\nCompleted expression: ${thread.completed-expression}}" \
+ "\\n"
+
#define DEFAULT_FRAME_FORMAT \
- "frame #${frame.index}: ${frame.pc}" MODULE_WITH_FUNC FILE_AND_LINE \
+ "frame #${frame.index}:{ ${frame.no-debug}${frame.pc}}" MODULE_WITH_FUNC FILE_AND_LINE \
IS_OPTIMIZED "\\n"
// Three parts to this disassembly format specification:
@@ -210,6 +221,10 @@ static PropertyDefinition g_properties[] = {
{"thread-format", OptionValue::eTypeFormatEntity, true, 0,
DEFAULT_THREAD_FORMAT, nullptr, "The default thread format string to use "
"when displaying thread information."},
+ {"thread-stop-format", OptionValue::eTypeFormatEntity, true, 0,
+ DEFAULT_THREAD_STOP_FORMAT, nullptr, "The default thread format "
+ "string to usewhen displaying thread "
+ "information as part of the stop display."},
{"use-external-editor", OptionValue::eTypeBoolean, true, false, nullptr,
nullptr, "Whether to use an external editor or not."},
{"use-color", OptionValue::eTypeBoolean, true, true, nullptr, nullptr,
@@ -247,6 +262,7 @@ enum {
ePropertyStopShowColumnAnsiSuffix,
ePropertyTerminalWidth,
ePropertyThreadFormat,
+ ePropertyThreadStopFormat,
ePropertyUseExternalEditor,
ePropertyUseColor,
ePropertyAutoOneLineSummaries,
@@ -359,6 +375,11 @@ const FormatEntity::Entry *Debugger::GetThreadFormat() const {
return m_collection_sp->GetPropertyAtIndexAsFormatEntity(nullptr, idx);
}
+const FormatEntity::Entry *Debugger::GetThreadStopFormat() const {
+ const uint32_t idx = ePropertyThreadStopFormat;
+ return m_collection_sp->GetPropertyAtIndexAsFormatEntity(nullptr, idx);
+}
+
lldb::ScriptLanguage Debugger::GetScriptLanguage() const {
const uint32_t idx = ePropertyScriptLanguage;
return (lldb::ScriptLanguage)m_collection_sp->GetPropertyAtIndexAsEnumeration(
@@ -1460,12 +1481,13 @@ void Debugger::HandleThreadEvent(const EventSP &event_sp) {
// and all we do for that is just reprint the thread status for that thread.
using namespace lldb;
const uint32_t event_type = event_sp->GetType();
+ const bool stop_format = true;
if (event_type == Thread::eBroadcastBitStackChanged ||
event_type == Thread::eBroadcastBitThreadSelected) {
ThreadSP thread_sp(
Thread::ThreadEventData::GetThreadFromEvent(event_sp.get()));
if (thread_sp) {
- thread_sp->GetStatus(*GetAsyncOutputStream(), 0, 1, 1);
+ thread_sp->GetStatus(*GetAsyncOutputStream(), 0, 1, 1, stop_format);
}
}
}
diff --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp
index f252ff55211..85965be35e5 100644
--- a/lldb/source/Core/FormatEntity.cpp
+++ b/lldb/source/Core/FormatEntity.cpp
@@ -97,6 +97,7 @@ static FormatEntity::Entry::Definition g_frame_child_entries[] = {
ENTRY("fp", FrameRegisterFP, UInt64),
ENTRY("sp", FrameRegisterSP, UInt64),
ENTRY("flags", FrameRegisterFlags, UInt64),
+ ENTRY("no-debug", FrameNoDebug, None),
ENTRY_CHILDREN("reg", FrameRegisterByName, UInt64, g_string_entry),
};
@@ -320,6 +321,7 @@ const char *FormatEntity::Entry::TypeToCString(Type t) {
ENUM_TO_CSTR(File);
ENUM_TO_CSTR(Lang);
ENUM_TO_CSTR(FrameIndex);
+ ENUM_TO_CSTR(FrameNoDebug);
ENUM_TO_CSTR(FrameRegisterPC);
ENUM_TO_CSTR(FrameRegisterSP);
ENUM_TO_CSTR(FrameRegisterFP);
@@ -1445,6 +1447,15 @@ bool FormatEntity::Format(const Entry &entry, Stream &s,
}
return false;
+ case Entry::Type::FrameNoDebug:
+ if (exe_ctx) {
+ StackFrame *frame = exe_ctx->GetFramePtr();
+ if (frame) {
+ return !frame->HasDebugInformation();
+ }
+ }
+ return true;
+
case Entry::Type::FrameRegisterByName:
if (exe_ctx) {
StackFrame *frame = exe_ctx->GetFramePtr();
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index a87ab4db1f5..5fe1e17b3c7 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -1199,10 +1199,12 @@ bool Process::HandleProcessStateChangedEvent(const EventSP &event_sp,
const uint32_t start_frame = 0;
const uint32_t num_frames = 1;
const uint32_t num_frames_with_source = 1;
+ const bool stop_format = true;
process_sp->GetStatus(*stream);
process_sp->GetThreadStatus(*stream, only_threads_with_stop_reason,
start_frame, num_frames,
- num_frames_with_source);
+ num_frames_with_source,
+ stop_format);
if (curr_thread_stop_info_sp) {
lldb::addr_t crashing_address;
ValueObjectSP valobj_sp = StopInfo::GetCrashingDereference(
@@ -5789,7 +5791,8 @@ void Process::GetStatus(Stream &strm) {
size_t Process::GetThreadStatus(Stream &strm,
bool only_threads_with_stop_reason,
uint32_t start_frame, uint32_t num_frames,
- uint32_t num_frames_with_source) {
+ uint32_t num_frames_with_source,
+ bool stop_format) {
size_t num_thread_infos_dumped = 0;
// You can't hold the thread list lock while calling Thread::GetStatus. That
@@ -5820,7 +5823,8 @@ size_t Process::GetThreadStatus(Stream &strm,
continue;
}
thread_sp->GetStatus(strm, start_frame, num_frames,
- num_frames_with_source);
+ num_frames_with_source,
+ stop_format);
++num_thread_infos_dumped;
} else {
Log *log(lldb_private::GetLogIfAnyCategoriesSet(LIBLLDB_LOG_PROCESS));
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 10678ecf415..8e2a9c740d0 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -1769,7 +1769,8 @@ Error Thread::JumpToLine(const FileSpec &file, uint32_t line,
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 @@ void Thread::DumpUsingSettingsFormat(Stream &strm, uint32_t frame_idx) {
}
}
- 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 @@ const char *Thread::RunModeAsCString(lldb::RunMode mode) {
}
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 @@ size_t Thread::GetStatus(Stream &strm, uint32_t start_frame,
}
}
- DumpUsingSettingsFormat(strm, start_frame);
+ DumpUsingSettingsFormat(strm, start_frame, stop_format);
if (num_frames > 0) {
strm.IndentMore();
@@ -1926,7 +1932,8 @@ size_t Thread::GetStatus(Stream &strm, uint32_t start_frame,
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();
diff --git a/lldb/www/formats.html b/lldb/www/formats.html
index dad3a4a2833..9e1db58f831 100755
--- a/lldb/www/formats.html
+++ b/lldb/www/formats.html
@@ -75,6 +75,7 @@
<tr valign=top><td><b>file.fullpath</b></td><td>The current compile unit file fullpath for the current frame.</td></tr>
<tr valign=top><td><b>language</b></td><td>The current compile unit language for the current frame.</td></tr>
<tr valign=top><td><b>frame.index</b></td><td>The frame index (0, 1, 2, 3...)</td></tr>
+ <tr valign=top><td><b>frame.no-debug</b></td><td>Evaluates to true if the frame has no debug info.</td></tr>
<tr valign=top><td><b>frame.pc</b></td><td>The generic frame register for the program counter.</td></tr>
<tr valign=top><td><b>frame.sp</b></td><td>The generic frame register for the stack pointer.</td></tr>
<tr valign=top><td><b>frame.fp</b></td><td>The generic frame register for the frame pointer.</td></tr>
OpenPOWER on IntegriCloud