Files
qt-creator/dist/gdb/patches/pythonhome.patch
Orgad Shaneh 6da16dc824 Upgrade to GDB 7.6.1
Change-Id: I9865d7d941719ddc228b6e4dea9abf0d702e3653
Reviewed-by: hjk <hjk121@nokiamail.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-10-31 15:25:34 +01:00

20 lines
648 B
Diff

--- a/gdb/python/python.c 2013-03-28 18:46:53.000000000 +0200
+++ b/gdb/python/python.c 2013-10-27 05:28:35.761204091 +0200
@@ -1568,6 +1568,16 @@ message == an error message without a st
#endif
#endif
+
+ char readlinkbuffer[BUFSIZ];
+ int readlinks = readlink("/proc/self/exe", readlinkbuffer, BUFSIZ - 1);
+ readlinkbuffer[readlinks] = 0;
+ char *executeablepath = dirname(readlinkbuffer);
+ char *pythonhome = malloc(strlen(executeablepath) + strlen("/python/") + 2);
+ strcpy(pythonhome, executeablepath);
+ strcat(pythonhome, "/python/");
+ setenv("PYTHONHOME", pythonhome, 1);
+
Py_Initialize ();
PyEval_InitThreads ();