diff options
author | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2011-11-01 21:43:50 +0100 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2011-11-01 23:23:03 +0100 |
commit | 2c3cd125be1e617a3b113f4898d131e4a10faae7 (patch) | |
tree | 1e2fd6f6ca01ba4d049c9deb01eab6358646e25b /util/crossgcc/patches | |
parent | e11835e2995d130890ca9f45cb3e304f2ea3a6a9 (diff) | |
download | coreboot-2c3cd125be1e617a3b113f4898d131e4a10faae7.tar.xz |
Add Python scripting to GDB.
This allows GDB to run Python scripts. The Python build is dependant on the GDB
build flag.
Changes by Stefan Reinauer:
- update to latest buildgcc script
- disable GDB per default
- disable python scripting, if GDB is not enabled
- bump version number to 1.06
Change-Id: Ie7fc8706deec41c804870415d3c79d225c98cd31
Signed-off-by: Marc Jones <marcj303@gmail.com>
Reviewed-on: http://review.coreboot.org/153
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'util/crossgcc/patches')
-rw-r--r-- | util/crossgcc/patches/gdb-7.3.1_pythonhome.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/util/crossgcc/patches/gdb-7.3.1_pythonhome.patch b/util/crossgcc/patches/gdb-7.3.1_pythonhome.patch new file mode 100644 index 0000000000..90da2d9d6f --- /dev/null +++ b/util/crossgcc/patches/gdb-7.3.1_pythonhome.patch @@ -0,0 +1,27 @@ +diff -ur gdb-7.3.1.orig/gdb/python/python.c gdb-7.3.1/gdb/python/python.c +--- gdb-7.3.1.orig/gdb/python/python.c 2011-07-02 21:33:10.000000000 +0200 ++++ gdb-7.3.1/gdb/python/python.c 2011-11-01 21:07:25.000000000 +0100 +@@ -33,6 +33,7 @@ + #include "python.h" + + #include <ctype.h> ++#include <libgen.h> + + /* True if we should print the stack when catching a Python error, + false otherwise. */ +@@ -1010,6 +1011,15 @@ + SLASH_STRING, "python", NULL)); + #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("/../") + 2); ++ strcpy(pythonhome, executeablepath); ++ strcat(pythonhome, "/../"); ++ setenv("PYTHONHOME", pythonhome, 1); ++ + Py_Initialize (); + PyEval_InitThreads (); + |