btrace: prepare for throwing exceptions when enabling btrace
We indicate success or failure for enabling branch tracing via the pointer
return value. Depending on the type of error, errno may provide additional
information.
Prepare for using exceptions with more descriptive error messages by using smart
pointers and objects with automatic destruction to hold intermediate results.
gdb/
* nat/linux-btrace.c: Include scoped_fd.h and scoped_mmap.h.
(perf_event_pt_event_type): Use gdb_file_up.
(linux_enable_bts, linux_enable_pt): Use gdb::unique_xmalloc_ptr,
scoped_fd, and scoped_mmap.