[trace] Use vector instead of ArrayRef when reading data
authorWalter Erquinigo <wallace@fb.com>
Mon, 21 Mar 2022 22:46:19 +0000 (15:46 -0700)
committerWalter Erquinigo <wallace@fb.com>
Mon, 21 Mar 2022 23:03:37 +0000 (16:03 -0700)
commit31e44c01e3b5cc2cc7a9f1dc49806b3f050efb82
treea2117c52b6df2f69c10ef6fde7f45e6caed05bcb
parentf4b794427e8037a4e952cacdfe7201e961f31a6f
[trace] Use vector instead of ArrayRef when reading data

I incorrectly returned an ArrayRef when the underlying object didn't own
the data. Instead, returning a vector<uint8_t> is what we should do.

This fixes an issue when trying to access an intel-pt trace buffer
larger than 16 MB.

repro
```
go to a breakpoint
thread trace start -s 16777216
n
thread trace dump instructions # this doesn't fail anymore
```

Differential Revision: https://reviews.llvm.org/D122192
lldb/include/lldb/Target/Trace.h
lldb/source/Target/Trace.cpp