]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
btrace: prepare for throwing exceptions when enabling btrace
authorMarkus Metzger <markus.t.metzger@intel.com>
Fri, 19 Jan 2018 08:38:33 +0000 (09:38 +0100)
committerMarkus Metzger <markus.t.metzger@intel.com>
Fri, 9 Feb 2018 13:03:19 +0000 (14:03 +0100)
commit5c3284c1ec2edc28b0697532fd094d93d5ecf31b
treeb66537e9c28d6ecc3a1d875a5debe5702ad3b6f6
parent84696f37ae92280ded0e6600074ad8bc518255fa
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.
gdb/ChangeLog
gdb/nat/linux-btrace.c