Hi,<br><br>I am currently trying to integrate Python support into my toolchain build (including GDB of course). It is a sysrooted binutils+GCC+GDB+mingw-w64 toolchain.<br><br>I currently have the basic setup working: I can link gdb with my manually generated import lib to the python dll from the official Windows install. If there is anything I am missing or a very easy solution to the problems decsribed below, please just say so. I am only suggesting what I would like to happen.<br>
<br>Now on to the problems I'd like to discuss:<br><br>1. gdb.exe won't start without me having set PYTHONPATH manually. I understand the need for this, but as gdb requires Python 2, and users of my toolchain may have installed Python 3 or a 32-bit version python they want to use from the same environment (without changing their own PYTHONPATH), there is no way to run python-enabled gdb. What I suggest is perhaps a Windows only change: a kind of "sysroot"ed gdb+python, so that the python used by gdb is truly built in. I cannot require everyone using my toolchain to install the correct python version for obvious reasons (Windows != Linux in this regard). However way this is tackled, the gdb I want should look relative to it's current (relocatable) directory for Python modules/*;py files in a well-defined directory at build time. That would allow me to distribute gdb in a very clear way:<br>
<br><sysroot><br><sysroot>/bin<br><sysroot>/bin/python27.dll<br><sysroot>/bin/gdb.exe<br><sysroot>/lib<br><sysroot>/lib/python27<br><sysroot>/lib/python27/<all *.py files from the official windows install><br>
<br>Currently, this scheme only works if I manually set the PYTHONPATH environment variable to <root>/lib/python27. This global environment variable could conflict with existing Python installations, that may have another bitness (I have 64- and 32-bit toolchains). I think you can see there are problems enough with the current set up. I also read this old discussion: <a href="http://comments.gmane.org/gmane.comp.gdb.patches/62811">http://comments.gmane.org/gmane.comp.gdb.patches/62811</a> that might imply that the PYTHONPATH check is something built-in to the python dll. Can anyone shed some light on this?<br>
<br>2. With PYTHONPATH set as a temporary workaround, gdb starts, but spits out a traceback:<br>Traceback (most recent call last):<br>  File "<string>", line 35, in <module><br>  File "m:\development\mingw64\share\gdb/python/gdb/__init__.py", line 18, in <module><br>
    gdb.command.pretty_printers.register_pretty_printer_commands()<br>  File "m:\development\mingw64\share\gdb/python/gdb\command\pretty_printers.py", line 368, in register_pretty_printer_commands<br>    InfoPrettyPrinter()<br>
  File "m:\development\mingw64\share\gdb/python/gdb\command\pretty_printers.py", line 100, in __init__<br>    gdb.COMMAND_DATA)<br>RuntimeError: Could not find command prefix info.<br><br>This is a minor problem I think, as "python import time" "python print time.clock()" works as expected. What is wrong?<br>
<br>Thanks very much!<br><br>Ruben<br><br>PS: I've sent this to both the gdb and python mailing lists, as these issues have a large overlap to both projects.<br>PS2: Please reply-to-all as I do not want daily mails from both mailing lists on every issue brought up there. My apologies.<br>