diff options
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/python.c | 5 | ||||
-rw-r--r-- | gdb/python/python.h | 13 |
2 files changed, 16 insertions, 2 deletions
diff --git a/gdb/python/python.c b/gdb/python/python.c index 1873936..55bb6cf 100644 --- a/gdb/python/python.c +++ b/gdb/python/python.c @@ -1390,8 +1390,9 @@ eval_python_from_control_command (struct command_line *cmd) void source_python_script (FILE *file, const char *filename) { - throw_error (UNSUPPORTED_ERROR, - _("Python scripting is not supported in this copy of GDB.")); + internal_error (__FILE__, __LINE__, + _("source_python_script called when Python scripting is " + "not supported.")); } int diff --git a/gdb/python/python.h b/gdb/python/python.h index c07b2aa..abbb581 100644 --- a/gdb/python/python.h +++ b/gdb/python/python.h @@ -89,6 +89,19 @@ typedef enum py_frame_args CLI_ALL_VALUES } py_frame_args; +/* Returns true if Python support is built into GDB, false + otherwise. */ + +static inline int +have_python (void) +{ +#ifdef HAVE_PYTHON + return 1; +#else + return 0; +#endif +} + extern void finish_python_initialization (void); void eval_python_from_control_command (struct command_line *); |