This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author qpatata
Recipients amaury.forgeotdarc, qpatata
Date 2010-09-22.20:44:20
SpamBayes Score 5.326704e-08
Marked as misclassified No
Message-id <1285188263.18.0.983544854518.issue9919@psf.upfronthosting.co.za>
In-reply-to
Content
Hello,

Thanks for your colaboration.

Starting by the following python file, called "prueba.py":

> cat prueba.py
import time

def bar():
    time.sleep(10);
    print "hello";

def foo():
  while True:
    bar();

foo();




Open a gdb session with python2-6 as target:

> gdb /usr/bin/python2.6

and run the python program. 

gdb> run prueba.py

After a few seconds, type Ctrl-C to break the program. Usually, break will interrupt it when execution is in the "sleep" statement. A "bt" gives:

#0  0xb7fe2424 in __kernel_vsyscall ()
#1  0xb7d42fdd in select () from /lib/i686/cmov/libc.so.6
#2  0x08119a3f in floatsleep (self=0x0, args=(10,)) at ../Modules/timemodule.c:918
#3  time_sleep (self=0x0, args=(10,)) at ../Modules/timemodule.c:206
#4  0x080e0721 in call_function (f=Frame 0x82e17ac, for file prueba.py, line 4, in bar (), 
    throwflag=0) at ../Python/ceval.c:3750
#5  PyEval_EvalFrameEx (f=Frame 0x82e17ac, for file prueba.py, line 4, in bar (), throwflag=0)
    at ../Python/ceval.c:2412
...

If we go until C frame #5 (up, up, ...) and execute the lineno macro:

#5  PyEval_EvalFrameEx (f=Frame 0x82e17ac, for file prueba.py, line 4, in bar (), throwflag=0)
    at ../Python/ceval.c:2412
2412    in ../Python/ceval.c

(gdb) lineno
5
(gdb) 

It is clear the mismatch between the line reported by lineno (5), the one in the source file (4) and the one displayed by gdb (4).

In addition, if we look at the version history of the "gdbinit" file, we can see how version 39276 has an implementation of lineno who matches the related C code in Python project, but next version (39492) introduces a boolean to control the end of loop. This change is, probably, the origen of the mismatch.

Thanks a lot.
History
Date User Action Args
2010-09-22 20:44:23qpatatasetrecipients: + qpatata, amaury.forgeotdarc
2010-09-22 20:44:23qpatatasetmessageid: <1285188263.18.0.983544854518.issue9919@psf.upfronthosting.co.za>
2010-09-22 20:44:21qpatatalinkissue9919 messages
2010-09-22 20:44:20qpatatacreate