Fix python gdbpy_breakpoint_object leak.
[deliverable/binutils-gdb.git] / gdb / python / py-gdb-readline.c
index ab14b8c8e8baf2485c6cdefc96d5f27227cd00c4..dcf3b83430914b3fd3c63b9f38c2ddb2241bde73 100644 (file)
@@ -1,6 +1,6 @@
 /* Readline support for Python.
 
-   Copyright (C) 2012-2017 Free Software Foundation, Inc.
+   Copyright (C) 2012-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -37,14 +37,15 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
 #endif
 {
   int n;
-  char *p = NULL, *q;
+  const char *p = NULL;
+  char *q;
 
-  TRY
+  try
     {
-      p = command_line_input (prompt, 0, "python");
+      p = command_line_input (prompt, "python");
     }
   /* Handle errors by raising Python exceptions.  */
-  CATCH (except, RETURN_MASK_ALL)
+  catch (const gdb_exception &except)
     {
       /* Detect user interrupt (Ctrl-C).  */
       if (except.reason == RETURN_QUIT)
@@ -59,7 +60,6 @@ gdbpy_readline_wrapper (FILE *sys_stdin, FILE *sys_stdout,
       PyEval_SaveThread ();
       return NULL;
     }
-  END_CATCH
 
   /* Detect EOF (Ctrl-D).  */
   if (p == NULL)
This page took 0.025143 seconds and 4 git commands to generate.