llvm-capstone/lldb
Raphael Isemann 6201017d54 [lldb] Prevent double new lines behind errors/warning/messages from LLDB commands
The current API for printing errors/warnings/messages from LLDB commands
sometimes adds newlines behind the messages for the caller. However, this
happens unconditionally so when the caller already specified a trailing newline
in the error message (or is trying to print a generated error message that ends
in a newline), LLDB ends up printing both the automatically added newline and
the one that was in the error message string. This leads to all the randomly
appearing new lines in error such as:

```
(lldb) command a
error: 'command alias' requires at least two arguments
(lldb) apropos a b
error: 'apropos' must be called with exactly one argument.

(lldb) why is there an empty line behind the second error?
```

This code adds a check that only appends the new line if the passed message
doesn't already contain a trailing new line.

Also removes the AppendRawWarning which had only one caller and doesn't serve
any purpose now.

Reviewed By: #lldb, mib

Differential Revision: https://reviews.llvm.org/D96947
2021-02-24 14:42:01 +01:00
..
bindings [lldb] Use internal_dict name over dict in python examples 2021-02-10 15:11:00 -08:00
cmake [lldb] Bump the required SWIG version to 3 2021-01-08 08:47:21 -08:00
docs [lldb] [docs] Update platform support status 2021-02-21 21:47:48 +01:00
examples [lldb] Remove LLDB session dir and just store test traces in the respective test build directory 2020-12-04 11:43:10 +01:00
include/lldb [lldb] Prevent double new lines behind errors/warning/messages from LLDB commands 2021-02-24 14:42:01 +01:00
packages/Python Reapply "[lldb/test] Automatically find debug servers to test" 2021-02-21 20:47:47 +01:00
resources [lldb] Remove stale LLDB-Info.plist 2021-01-08 10:12:16 -08:00
scripts [lldb][AArch64/Linux] Show memory tagged memory regions 2020-11-20 11:21:59 +00:00
source [lldb] Prevent double new lines behind errors/warning/messages from LLDB commands 2021-02-24 14:42:01 +01:00
test [lldb] Prevent double new lines behind errors/warning/messages from LLDB commands 2021-02-24 14:42:01 +01:00
third_party/Python/module Revert "[lldb] temporary commit to see why a test is failing only on lldb-aarch64-ubuntu" 2020-08-05 11:55:02 +02:00
tools Revert "[lldb-vscode] Emit the breakpoint changed event on location resolved" 2021-02-21 13:08:06 -08:00
unittests [lldb] [Process/FreeBSDRemote] Fix clang-formatting on ppc commit 2021-02-14 22:34:25 +01:00
utils Reapply "[lldb/test] Automatically find debug servers to test" 2021-02-21 20:47:47 +01:00
.clang-format
.clang-tidy [lldb] Add .clang-tidy with customization to disable readability-identifier-naming 2020-03-09 12:50:28 -07:00
.gitignore
CMakeLists.txt [CMake] Remove dead code setting policies to NEW 2021-01-19 17:19:36 +02:00
CODE_OWNERS.txt
LICENSE.TXT
use_lldb_suite_root.py