-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb] Highlight "note:" in CommandReturnObject #114610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,12 @@ static llvm::raw_ostream &warning(Stream &strm) { | |
<< "warning: "; | ||
} | ||
|
||
static llvm::raw_ostream ¬e(Stream &strm) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually |
||
return llvm::WithColor(strm.AsRawOstream(), llvm::HighlightColor::Note, | ||
llvm::ColorMode::Enable) | ||
<< "note: "; | ||
} | ||
|
||
static void DumpStringToStreamWithNewline(Stream &strm, const std::string &s) { | ||
bool add_newline = false; | ||
if (!s.empty()) { | ||
|
@@ -74,6 +80,18 @@ void CommandReturnObject::AppendMessageWithFormat(const char *format, ...) { | |
GetOutputStream() << sstrm.GetString(); | ||
} | ||
|
||
void CommandReturnObject::AppendNoteWithFormat(const char *format, ...) { | ||
if (!format) | ||
return; | ||
va_list args; | ||
va_start(args, format); | ||
StreamString sstrm; | ||
sstrm.PrintfVarArg(format, args); | ||
va_end(args); | ||
|
||
note(GetOutputStream()) << sstrm.GetString(); | ||
} | ||
|
||
void CommandReturnObject::AppendWarningWithFormat(const char *format, ...) { | ||
if (!format) | ||
return; | ||
|
@@ -92,6 +110,12 @@ void CommandReturnObject::AppendMessage(llvm::StringRef in_string) { | |
GetOutputStream() << in_string.rtrim() << '\n'; | ||
} | ||
|
||
void CommandReturnObject::AppendNote(llvm::StringRef in_string) { | ||
if (in_string.empty()) | ||
return; | ||
note(GetOutputStream()) << in_string.rtrim() << '\n'; | ||
} | ||
|
||
void CommandReturnObject::AppendWarning(llvm::StringRef in_string) { | ||
if (in_string.empty()) | ||
return; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, didn't know about
__attribute__((format(printf