llvm-project/lldb/test
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
..
API [lldb] Add deref support and tests to shared_ptr synthetic 2021-02-23 09:03:46 -08:00
Shell [lldb] Prevent double new lines behind errors/warning/messages from LLDB commands 2021-02-24 14:42:01 +01:00
Unit [lldb] Use config.lldb_src_root in lit_config.load_config (NFC) 2020-09-29 23:05:12 -07:00
CMakeLists.txt [lldb] add check for libcxx runtime 2021-02-22 17:53:54 -08:00
lit.cfg.py [test] Cleanup top-level lit.cfg.py 2019-10-10 19:51:47 +00:00
lit.site.cfg.py.in [lldb] Get rid of helper CMake variables for Python 2020-08-17 08:47:52 -07:00