[lldb] Copy log files into diagnostic directory
authorJonas Devlieghere <jonas@devlieghere.com>
Tue, 7 Mar 2023 23:59:30 +0000 (15:59 -0800)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 8 Mar 2023 00:00:27 +0000 (16:00 -0800)
commit9d311dd6a71ba3910554b81fec5e6d5799ce0453
treeb56a71af5355a4ab922dd34edee130be5ed7a129
parentbfb180587c36b054dcf235bbb23533e81303ebbf
[lldb] Copy log files into diagnostic directory

This patch copies over log files to the diagnostic directory. The caveat
here is that this only works for logs that are redirected to a file. The
implementation piggybacks of the mapping kept by the debugger. The
advantage is that it's free until you generate the diagnostics, at which
point you only pay the price of copying over the file.

Differential revision: https://reviews.llvm.org/D135631
lldb/include/lldb/Core/Debugger.h
lldb/source/Core/Debugger.cpp
lldb/test/Shell/Diagnostics/Inputs/TestCopyLogs.in [new file with mode: 0644]
lldb/test/Shell/Diagnostics/TestCopyLogs.test [new file with mode: 0644]