Use unique_xmalloc_ptr in fixup_go_packaging
[deliverable/binutils-gdb.git] / gdb / guile / scm-ports.c
index 57d3b18f96278fde992bfb5dc2ae64b2c3775577..3df186412e0103237ced8f9e613b4a15dbd1253b 100644 (file)
@@ -1,7 +1,7 @@
 /* Support for connecting Guile's stdio to GDB's.
    as well as r/w memory via ports.
 
-   Copyright (C) 2014-2019 Free Software Foundation, Inc.
+   Copyright (C) 2014-2020 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -26,7 +26,7 @@
 #include "top.h"
 #include "target.h"
 #include "guile-internal.h"
-#include "common/gdb_optional.h"
+#include "gdbsupport/gdb_optional.h"
 
 #ifdef HAVE_POLL
 #if defined (HAVE_POLL_H)
@@ -272,6 +272,7 @@ ioscm_write (SCM port, const void *data, size_t size)
   if (scm_is_eq (port, input_port_scm))
     return;
 
+  gdbscm_gdb_exception exc {};
   try
     {
       if (scm_is_eq (port, error_port_scm))
@@ -281,8 +282,9 @@ ioscm_write (SCM port, const void *data, size_t size)
     }
   catch (const gdb_exception &except)
     {
-      GDBSCM_HANDLE_GDB_EXCEPTION (except);
+      exc = unpack (except);
     }
+  GDBSCM_HANDLE_GDB_EXCEPTION (exc);
 }
 
 /* Flush gdb's stdout or stderr.  */
This page took 0.029681 seconds and 4 git commands to generate.