1

I followed the instructions to install Python pretty-printers mentioned in the below website. https://sourceware.org/gdb/wiki/STLSupport

I checked-out the python module in my E:\Project directory. I created a .gdbinit file and replaced the path by E:\Project\python and finally placed the file in C:\Users\username folder. (I even tried placing in the current working directory E:\Project).

In either case, I seem to get the following message:

PS E:\Project> gdb .\practise
GNU gdb (GDB) 7.6.1
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "mingw32".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from E:\Project\practise.exe...done.
warning: File "E:\Project\.gdbinit" auto-loading has been declined by your `auto-load safe-path' set to "$debugdir:$datadir/auto-load".
To enable execution of this file add
        add-auto-load-safe-path E:\Project\.gdbinit
line to your configuration file "$HOME/.gdbinit".
To completely disable this security protection add
        set auto-load safe-path /
line to your configuration file "$HOME/.gdbinit".
For more information about this security protection see the
"Auto-loading safe path" section in the GDB manual.  E.g., run from the shell:
        info "(gdb)Auto-loading safe path"

I tried adding the line set auto-load safe-path / in .gdbinit file, but it continued to display the same message.

There are very few posts related to pretty-printers with MinGW. The methods mentioned in the following post didn't work either. How do I load .gdbinit on gdb startup?

Can someone please help me in getting the Python pretty-printers to work with MinGW on Windows?

DoubtExpert
  • 71
  • 1
  • 10

1 Answers1

2

It turned out that MinGW version installed was not Python enabled. To check whether the gdb is Python enabled, execute the following command in gdb:

(gdb) python print sys.version

If it does not support Python, install MingW-W64-builds from their website:
http://mingw-w64.org/doku.php/download
This version of MinGW supports Python.

Make sure Python 2.7 is installed on your system.
On updating the .gdbinit file, Python pretty-printers must work on Windows.

DoubtExpert
  • 71
  • 1
  • 10