gdb: Don't skip prologue for explicit line breakpoints in assembler
[deliverable/binutils-gdb.git] / gdb / common / common-exceptions.h
index 33fa8a92ec26693b69d94ffa55fbc144b578afbb..ebcaf031354336ae733fe6cc0f28228fa386e3db 100644 (file)
@@ -133,6 +133,10 @@ struct gdb_exception
   {
   }
 
+  /* The move constructor exists so that we can mark it "noexcept",
+     which is a good practice for any sort of exception object.  */
+  explicit gdb_exception (gdb_exception &&other) noexcept = default;
+
   /* The copy constructor exists so that we can mark it "noexcept",
      which is a good practice for any sort of exception object.  */
   gdb_exception (const gdb_exception &other) noexcept
@@ -152,6 +156,8 @@ struct gdb_exception
     return *this;
   }
 
+  gdb_exception &operator= (gdb_exception &&other) noexcept = default;
+
   /* Return the contents of the exception message, as a C string.  The
      string remains owned by the exception object.  */
   const char *what () const noexcept
@@ -230,8 +236,8 @@ struct gdb_exception_error : public gdb_exception
   {
   }
 
-  explicit gdb_exception_error (const gdb_exception &ex) noexcept
-    : gdb_exception (ex)
+  explicit gdb_exception_error (gdb_exception &&ex) noexcept
+    : gdb_exception (std::move (ex))
   {
     gdb_assert (ex.reason == RETURN_ERROR);
   }
@@ -245,8 +251,8 @@ struct gdb_exception_quit : public gdb_exception
   {
   }
 
-  explicit gdb_exception_quit (const gdb_exception &ex) noexcept
-    : gdb_exception (ex)
+  explicit gdb_exception_quit (gdb_exception &&ex) noexcept
+    : gdb_exception (std::move (ex))
   {
     gdb_assert (ex.reason == RETURN_QUIT);
   }
@@ -262,8 +268,8 @@ struct gdb_quit_bad_alloc
   : public gdb_exception_quit,
     public std::bad_alloc
 {
-  explicit gdb_quit_bad_alloc (const gdb_exception &ex) noexcept
-    : gdb_exception_quit (ex),
+  explicit gdb_quit_bad_alloc (gdb_exception &&ex) noexcept
+    : gdb_exception_quit (std::move (ex)),
       std::bad_alloc ()
   {
   }
@@ -274,14 +280,14 @@ struct gdb_quit_bad_alloc
 /* Throw an exception (as described by "struct gdb_exception"),
    landing in the inner most containing exception handler established
    using TRY/CATCH.  */
-extern void throw_exception (const gdb_exception &exception)
+extern void throw_exception (gdb_exception &&exception)
      ATTRIBUTE_NORETURN;
 
 /* Throw an exception by executing a LONG JUMP to the inner most
    containing exception handler established using TRY_SJLJ.  Necessary
    in some cases where we need to throw GDB exceptions across
    third-party library code (e.g., readline).  */
-extern void throw_exception_sjlj (struct gdb_exception exception)
+extern void throw_exception_sjlj (const struct gdb_exception &exception)
      ATTRIBUTE_NORETURN;
 
 /* Convenience wrappers around throw_exception that throw GDB
This page took 0.024678 seconds and 4 git commands to generate.