btrace, gdbserver: use exceptions to convey btrace enable/disable errors
Change error reporting to use exceptions and be prepared to catch them in
gdbserver. We use the exception message in our error reply to GDB.
This may remove some detail from the error message in the native case since
errno is no longer printed. Later patches will improve that.
We're still using error strings on the RSP level. This patch does not affect
the interoperability of older/newer GDB/gdbserver.
gdbserver/
* server.c (handle_btrace_enable_bts, handle_btrace_enable_pt)
(handle_btrace_disable): Change return type to void. Use exceptions
to report errors.
(handle_btrace_general_set): Catch exception and copy message to
return message.
gdb/
* nat/linux-btrace.c (linux_enable_btrace): Throw exception if enabling
btrace failed.
* x86-linux-nat.c (x86_linux_enable_btrace): Catch btrace enabling
exception and use message in own exception.