[Lldb-commits] [PATCH] D62743: Add color to the default thread and frame format.

Jonas Devlieghere via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri May 31 10:30:35 PDT 2019


JDevlieghere created this revision.
JDevlieghere added reviewers: clayborg, aprantl, teemperor, labath.
Herald added a project: LLDB.

Now that we correctly ignore ASCII escape sequences (r 362240) when colors are disabled, I'd like to change the the default frame and thread format to include color in their output, in line with the syntax highlighting that Raphael added a while ago. More specifically, I want to highlight the stop reason and the file + line/column number. With colors disabled, this of course is a no-op.

Please see the following screenshot for example output: https://i.imgur.com/KRZhxSz.png


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D62743

Files:
  lldb/source/Core/Debugger.cpp


Index: lldb/source/Core/Debugger.cpp
===================================================================
--- lldb/source/Core/Debugger.cpp
+++ lldb/source/Core/Debugger.cpp
@@ -121,7 +121,10 @@
   "{${frame.no-debug}${function.pc-offset}}}}"
 
 #define FILE_AND_LINE                                                          \
-  "{ at ${line.file.basename}:${line.number}{:${line.column}}}"
+  "{ at ${ansi.fg.yellow}"                                                     \
+  "${line.file.basename}:${line.number}{:${line.column}"                       \
+  "}${ansi.normal}}"
+
 #define IS_OPTIMIZED "{${function.is-optimized} [opt]}"
 
 #define IS_ARTIFICIAL "{${frame.is-artificial} [artificial]}"
@@ -133,7 +136,7 @@
   "{, queue = '${thread.queue}'}"                                              \
   "{, activity = '${thread.info.activity.name}'}"                              \
   "{, ${thread.info.trace_messages} messages}"                                 \
-  "{, stop reason = ${thread.stop-reason}}"                                    \
+  "{, stop reason = ${ansi.fg.red}${thread.stop-reason}${ansi.normal}}"        \
   "{\\nReturn value: ${thread.return-value}}"                                  \
   "{\\nCompleted expression: ${thread.completed-expression}}"                  \
   "\\n"
@@ -143,7 +146,7 @@
   "{, queue = '${thread.queue}'}"                                              \
   "{, activity = '${thread.info.activity.name}'}"                              \
   "{, ${thread.info.trace_messages} messages}"                                 \
-  "{, stop reason = ${thread.stop-reason}}"                                    \
+  "{, stop reason = ${ansi.fg.red}${thread.stop-reason}${ansi.normal}}"        \
   "{\\nReturn value: ${thread.return-value}}"                                  \
   "{\\nCompleted expression: ${thread.completed-expression}}"                  \
   "\\n"


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62743.202457.patch
Type: text/x-patch
Size: 1907 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20190531/50d48517/attachment.bin>


More information about the lldb-commits mailing list