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 vstinner
Recipients dmalcolm, vstinner
Date 2011-05-04.09:08:14
SpamBayes Score 9.5854436e-12
Marked as misclassified No
Message-id <1304500095.82.0.965528459857.issue11996@psf.upfronthosting.co.za>
In-reply-to
Content
py-bt is too much verbose, I'm unable to read it.

Example:
--------------------
$ gdb -args ./python -c 'import time, threading; threading.Thread(target=lambda:time.sleep(3)).start()'
...
[New Thread 0x7ffff69d9700 (LWP 17193)]
^C
Program received signal SIGINT, Interrupt.
sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
86	../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Aucun fichier ou dossier de ce type.
	in ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
(gdb) py-bt
#6 Frame 0xc52620, for file /home/haypo/prog/HG/cpython/Lib/threading.py, line 237, in wait (self=<_Condition(release=<built-in method release of _thread.lock object at remote 0xc1f1e0>, acquire=<built-in method acquire of _thread.lock object at remote 0xc1f1e0>, _lock=<_thread.lock at remote 0xc1f1e0>, _waiters=[<_thread.lock at remote 0xafb590>], _verbose=False) at remote 0xc1cbe0>, timeout=None, waiter=<_thread.lock at remote 0xafb590>, saved_state=None)
                waiter.acquire()
#10 Frame 0xbbb580, for file /home/haypo/prog/HG/cpython/Lib/threading.py, line 851, in join (self=<Thread(_target=<function at remote 0xbb5d30>, _block=<_Condition(release=<built-in method release of _thread.lock object at remote 0xc1f1e0>, acquire=<built-in method acquire of _thread.lock object at remote 0xc1f1e0>, _lock=<_thread.lock at remote 0xc1f1e0>, _waiters=[<_thread.lock at remote 0xafb590>], _verbose=False) at remote 0xc1cbe0>, _args=(), _initialized=True, _name='Thread-1', _daemonic=False, _kwargs={}, _stderr=<_io.TextIOWrapper at remote 0xac15a0>, _ident=140737330910976, _started=<_Event(_flag=True, _cond=<_Condition(release=<built-in method release of _thread.lock object at remote 0xad7e00>, acquire=<built-in method acquire of _thread.lock object at remote 0xad7e00>, _lock=<_thread.lock at remote 0xad7e00>, _waiters=[], _verbose=False) at remote 0xc1ce40>, _verbose=False) at remote 0xaec980>, _stopped=False, _verbose=False) at remote 0xc2fb70>, timeout=None)
                    self._block.wait()
#14 Frame 0xc42eb0, for file /home/haypo/prog/HG/cpython/Lib/threading.py, line 965, in _exitfunc (self=<_MainThread(_target=None, _block=<_Condition(release=<built-in method release of _thread.lock object at remote 0xc66290>, acquire=<built-in method acquire of _thread.lock object at remote 0xc66290>, _lock=<_thread.lock at remote 0xc66290>, _waiters=[], _verbose=False) at remote 0xc66110>, _args=(), _initialized=True, _name='MainThread', _daemonic=False, _kwargs={}, _stderr=<_io.TextIOWrapper at remote 0xac15a0>, _ident=140737353987840, _started=<_Event(_flag=True, _cond=<_Condition(release=<built-in method release of _thread.lock object at remote 0xc62fe0>, acquire=<built-in method acquire of _thread.lock object at remote 0xc62fe0>, _lock=<_thread.lock at remote 0xc62fe0>, _waiters=[], _verbose=False) at remote 0xc65d20>, _verbose=False) at remote 0xc65840>, _stopped=True, _verbose=False) at remote 0xc64c90>, t=<Thread(_target=<function at remote 0xbb5d30>, _block=<_Condition(release=<built-in method release o...(truncated)
            t.join()
--------------------

Attached patch uses a syntax closer to classic Python tracebacks:
--------------------
$ gdb -args ./python -c 'import time, threading; (gdb) run
...
[New Thread 0x7ffff69d9700 (LWP 17193)]
^C
Program received signal SIGINT, Interrupt.
sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
86	../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S: Aucun fichier ou dossier de ce type.
	in ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S
(gdb) py-bt
Traceback (most recent call first):
  File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 237, in wait
  File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 851, in join
  File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 965, in _exitfunc
(gdb) info threads
  2 Thread 0x7ffff69d9700 (LWP 17193)  0x00007ffff72a0c73 in select () at ../sysdeps/unix/syscall-template.S:82
* 1 Thread 0x7ffff7fdb700 (LWP 17190)  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
(gdb) thread 2
[Switching to thread 2 (Thread 0x7ffff69d9700 (LWP 17193))]#0  0x00007ffff72a0c73 in select ()
    at ../sysdeps/unix/syscall-template.S:82
82	../sysdeps/unix/syscall-template.S: Aucun fichier ou dossier de ce type.
	in ../sysdeps/unix/syscall-template.S
(gdb) py-bt
Traceback (most recent call first):
  File "<string>", line 1, in <lambda>
  File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 690, in run
  File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 737, in _bootstrap_inner
  File "/home/haypo/prog/HG/cpython/Lib/threading.py", line 710, in _bootstrap
--------------------
History
Date User Action Args
2011-05-04 09:08:15vstinnersetrecipients: + vstinner, dmalcolm
2011-05-04 09:08:15vstinnersetmessageid: <1304500095.82.0.965528459857.issue11996@psf.upfronthosting.co.za>
2011-05-04 09:08:15vstinnerlinkissue11996 messages
2011-05-04 09:08:14vstinnercreate