diff options
author | Jim Ingham <jingham@apple.com> | 2016-11-08 20:36:40 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2016-11-08 20:36:40 +0000 |
commit | 6a9767c7e6983c3211e35757899fb83afb2eb807 (patch) | |
tree | d3d4fc44de0827c79099978569ee676feb81c604 /lldb/source/Core/Debugger.cpp | |
parent | edc183e4375ab9b5be5487035327ca14ab7c322b (diff) | |
download | bcm5719-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
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
-rw-r--r-- | lldb/source/Core/Debugger.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
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); } } } |