aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/python')
-rw-r--r--gdb/python/python.c9
-rw-r--r--gdb/python/python.h2
2 files changed, 5 insertions, 6 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 41a9443..b21ea99 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -364,10 +364,11 @@ gdbpy_parse_and_eval (PyObject *self, PyObject *args)
}
/* Read a file as Python code. STREAM is the input file; FILE is the
- name of the file. */
+ name of the file.
+ STREAM is not closed, that is the caller's responsibility. */
void
-source_python_script (FILE *stream, char *file)
+source_python_script (FILE *stream, const char *file)
{
struct cleanup *cleanup;
@@ -375,7 +376,6 @@ source_python_script (FILE *stream, char *file)
PyRun_SimpleFile (stream, file);
- fclose (stream);
do_cleanups (cleanup);
}
@@ -562,9 +562,8 @@ eval_python_from_control_command (struct command_line *cmd)
}
void
-source_python_script (FILE *stream, char *file)
+source_python_script (FILE *stream, const char *file)
{
- fclose (stream);
throw_error (UNSUPPORTED_ERROR,
_("Python scripting is not supported in this copy of GDB."));
}
diff --git a/gdb/python/python.h b/gdb/python/python.h
index 5d93f67..b2a9631 100644
--- a/gdb/python/python.h
+++ b/gdb/python/python.h
@@ -24,7 +24,7 @@
void eval_python_from_control_command (struct command_line *);
-void source_python_script (FILE *stream, char *file);
+void source_python_script (FILE *stream, const char *file);
int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr,
int embedded_offset, CORE_ADDR address,