b366739 Get rid of gdb_exception::message copying/xstrdup'ing

Authored and Committed by palves 7 years ago
    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.
        
file modified
+2 -2
file modified
+3 -3
file modified
+1 -1
file modified
+7 -7
file modified
+2 -3
file modified
+1 -1
file modified
+1 -1
file modified
+1 -1
file modified
+2 -2
file modified
+4 -4
file modified
+6 -6
file modified
+1 -1
file modified
+5 -5
file modified
+3 -3
file modified
+2 -2
file modified
+3 -3
file modified
+3 -3
file modified
+3 -3
file modified
+1 -1
file modified
+1 -1
file modified
+5 -13
file modified
+3 -3
file modified
+1 -1
file modified
+7 -7
file modified
+3 -3
file modified
+2 -2
file modified
+1 -1
file modified
+1 -1
file modified
+3 -3
file modified
+2 -2
file modified
+1 -1
file modified
+1 -1
file modified
+1 -1
file modified
+5 -5