[PATCH] Warn about data-directory when failing to import Python "gdb" module

Khoo Yit Phang
2012-09-17T19:36:59Z

[-- Attachment #1: Type: text/plain, Size: 295 bytes --]

Hi,

I'd like to add a warning when failing to import the Python "gdb" module to check that data-directory is set correctly, to address the confusion arising from the incompatibility between the old "gdb" module and the one I recently checked in.

Thank you,

Yit
September 17, 2012

[-- Attachment #2: warn-gdb-python-compat.txt --]
[-- Type: text/plain, Size: 681 bytes --]

gdb/ChangeLog

2012-09-17 Khoo Yit Phang <khooyp@cs.umd.edu>

* gdb/python.c (finish_python_initialization): Augment the warning
when importing "gdb" fails, to check that data-directory is set
correctly.

diff --git a/gdb/python/python.c b/gdb/python/python.c
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -1484,6 +1484,7 @@
gdbpy_print_stack ();
warning (_("Could not load the Python gdb module from `%s'."),
gdb_pythondir);
+ warning (_("Please make sure that data-directory is set correctly."));
warning (_("Limited Python support is available from the _gdb module."));
do_cleanups (cleanup);
return;