llvm-project/lldb/test/Shell/Breakpoint
Jonas Devlieghere 1a216fb15a [lldb] Don't print script output twice in HandleCommand
When executing a script command in HandleCommand(s) we currently print
its output twice
You can see this issue in action when adding a breakpoint command:

(lldb) b main
Breakpoint 1: where = main.out`main + 13 at main.cpp:2:3, address = 0x0000000100003fad
(lldb) break command add 1 -o "script print(\"Hey!\")"
(lldb) r
Process 76041 launched: '/tmp/main.out' (x86_64)
Hey!
(lldb)  script print("Hey!")
Hey!
Process 76041 stopped

The issue is caused by HandleCommands using a temporary
CommandReturnObject and one of the commands (`script` in this case)
setting an immediate output stream. This causes the result to be printed
twice: once directly to the immediate output stream and once when
printing the result of HandleCommands.

This patch fixes the issue by introducing a new option to suppress
immediate output for temporary CommandReturnObjects.

Differential revision: https://reviews.llvm.org/D103349
2021-06-08 13:57:39 -07:00
..
Inputs
breakpoint-command.test [lldb] Don't print script output twice in HandleCommand 2021-06-08 13:57:39 -07:00
case-insensitive.test
case-sensitive.test
debug_addrx.test [test] Replace `yaml2obj >` with `yaml2obj -o` and remove unneeded input redirection 2020-08-20 15:01:09 -07:00
debug_rnglist_basic.test [test] Replace `yaml2obj >` with `yaml2obj -o` and remove unneeded input redirection 2020-08-20 15:01:09 -07:00
debug_rnglist_offset_pair.test [test] Replace `yaml2obj >` with `yaml2obj -o` and remove unneeded input redirection 2020-08-20 15:01:09 -07:00
debug_rnglist_rlestartend.test [test] Replace `yaml2obj >` with `yaml2obj -o` and remove unneeded input redirection 2020-08-20 15:01:09 -07:00
debug_rnglistx_rlex.test [test] Replace `yaml2obj >` with `yaml2obj -o` and remove unneeded input redirection 2020-08-20 15:01:09 -07:00
dummy-target.test
jit-loader_jitlink_elf.test [lldb][JITLoaderGDB] Test debug support in JITLink 2021-03-09 14:10:52 +01:00
jit-loader_rtdyld_elf.test [lldb][JITLoaderGDB] Test debug support in JITLink 2021-03-09 14:10:52 +01:00
ppc64-localentry.test
single-file-split-dwarf.test [test] Replace `yaml2obj >` with `yaml2obj -o` and remove unneeded input redirection 2020-08-20 15:01:09 -07:00
split-dwarf-5-addrbase.test [test] Replace `yaml2obj >` with `yaml2obj -o` and remove unneeded input redirection 2020-08-20 15:01:09 -07:00
split-dwarf5-debug-stroffsets.test [test] Replace `yaml2obj >` with `yaml2obj -o` and remove unneeded input redirection 2020-08-20 15:01:09 -07:00