From 4c63965b8a74d9dd3d8ed6fed659c4db977c6ddd Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Thu, 26 Jan 2012 21:54:45 +0000 Subject: gdb/ Do not open script filenames twice. * cli/cli-cmds.c (source_script_from_stream): Pass to source_python_script also STREAM. * python/py-auto-load.c (source_section_scripts): Pass to source_python_script_for_objfile also STREAM. (auto_load_objfile_script): Pass to source_python_script_for_objfile also INPUT. * python/python-internal.h (source_python_script_for_objfile): New parameter file, rename parameter file to filename. * python/python.c (python_run_simple_file): Call PyRun_SimpleFile instead if !_WIN32. Update the function comment. (source_python_script, source_python_script_for_objfile) (source_python_script): New parameter file, rename parameter file to filename. Pass FILENAME to python_run_simple_file. * python/python.h (source_python_script): New parameter file, rename parameter file to filename. --- gdb/cli/cli-cmds.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gdb/cli/cli-cmds.c') diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c index 15b6b79..9c118e1 100644 --- a/gdb/cli/cli-cmds.c +++ b/gdb/cli/cli-cmds.c @@ -539,9 +539,7 @@ source_script_from_stream (FILE *stream, const char *file) TRY_CATCH (e, RETURN_MASK_ERROR) { - /* The python support reopens the file using python functions, - so there's no point in passing STREAM here. */ - source_python_script (file); + source_python_script (stream, file); } if (e.reason < 0) { -- cgit v1.1