Get rid of gdb_exception::message copying/xstrdup'ing
Gets rid of all gdb_exception (and thus gdb_exception::message)
copying introduded by the previous patch, by:
- using rethrow_exception whenever we want to rethrow from within a
catch block. rethrow_exception does "throw;", which throws the
original exception object.
- making throw_exception take an rval reference, in order to allow
moving the original exception's message string into the thrown
exception object.
I thought of making throw_exception take a non-const lval reference,
which should work too, but it feels like forcing callers to use
gdb::move is less surprising. Otherwise, there'd be no visible clue
at the caller site that would make it obvious that throw_exception
destroys its argument.
Actually, now that I think more about this, since we're always going
to end up copying the exception, it may be better to instead rely on
copy elision, and keep things simpler by always passing by value
around. The rethrow_exception bits should still be useful though.