diff --git a/.gitignore b/.gitignore index 00efe9f03..03a9d04db 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,6 @@ gcm.cache/ # Mac option *.DS_Store + +# Pretty Printers +*.pyc diff --git a/doc/modules/ROOT/pages/debugger.adoc b/doc/modules/ROOT/pages/debugger.adoc index 4521183a7..4603ca5aa 100644 --- a/doc/modules/ROOT/pages/debugger.adoc +++ b/doc/modules/ROOT/pages/debugger.adoc @@ -25,7 +25,7 @@ To load the pretty printer, add the following line to your `.gdbinit`: [source] ---- -python exec(open("/path/to/decimal/extra/decimal_printer_gdb.py").read()) +source /path/to/decimal/extra/decimal_printer_gdb.py ---- or you can source it manually in GDB: diff --git a/extra/decimal_printer_gdb.py b/extra/decimal_printer_gdb.py index 05e2671fe..e58feab54 100644 --- a/extra/decimal_printer_gdb.py +++ b/extra/decimal_printer_gdb.py @@ -2,6 +2,10 @@ # Distributed under the Boost Software License, Version 1.0. # https://www.boost.org/LICENSE_1_0.txt +import sys +import os +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) + from detail.decode_ieee_type import decode_decimal32 from detail.decode_ieee_type import decode_decimal64 from detail.decode_ieee_type import decode_decimal128