New submission from Arcadiy Ivanov:

Around line 1480 of configure.ac:
            if test "$Py_DEBUG" = 'true' ; then
                # Optimization messes up debuggers, so turn it off for
                # debug builds.
                if "$CC" -v --help 2>/dev/null |grep -- -Og > /dev/null; then
                    OPT="-g -Og -Wall $STRICT_PROTO"
                else
                    OPT="-g -O0 -Wall $STRICT_PROTO"
                fi
            else
                OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
            fi

The "-Og", unfortunately, optimizes too much resulting in local variables and 
arguments being optimized out:

(gdb) info locals
kwlist = {0x7ffff02c3318 "database", 0x7ffff02c3321 "timeout", 0x7ffff02c3329 
"detect_types", 0x7ffff02c3336 "isolation_level", 0x7ffff02c3346 
"check_same_thread", 0x7ffff02c3392 "factory", 0x7ffff02c3358 
"cached_statements", 
  0x7ffff02c336a "uri", 0x0}
database = 0x7ffff04f7da0 ":memory:"
detect_types = 0
isolation_level = 0x1
factory = 0x7ffff04c7dc0 <pysqlite_ConnectionType>
check_same_thread = 1
cached_statements = 4888694
uri = 0
timeout = 5
(gdb) info args
self = <optimized out>
args = 0x7fffeff6be28
kwargs = 0x0

When "self" is optimized out it's too much optimization for debug mode.

----------
components: Build
messages: 285505
nosy: arcivanov
priority: normal
severity: normal
status: open
title: --with-pydebug optimizes too much
versions: Python 3.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29279>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to