Professional IronPython



Download 20,35 Mb.
Pdf ko'rish
bet269/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   265   266   267   268   269   270   271   272   ...   453
256

CHAPTER 12
Debugging ironPython APPlicAtions
FIgURE 12-8: 
IronPython lacks support for stack traces, making debugging significantly more difficult.
The 
traceback
module contains a number of interesting functions that you can use to debug your 
application. You can see these functions described at 
http://docs.python.org/library/traceback 
.html
. Don’t assume that all of these functions work as they do in Python. There are currently a num-
ber of outstanding 
traceback
module issues for IronPython.
dEbUggINg WITH THE PyTHoN dEbUggER
You might not know it, but Python and IronPython come with a debugger module, 
pdb
(for Python 
debugger). Like any module, you have full access to the debugger source code and can modify it as 
needed. This section describes the default debugger performance.
It’s possible to use 
pdb
with any Python file by invoking the debugger at the command line using the 
–m
command line switch. Here’s how you’d invoke it for the example shown in Listing 12-1.
IPY -m pdb ShowFilters.py
Unfortunately, using this command line format limits what you can do with the debugger. Although 
you can single step through code, you can’t work with variables easily and some other debugger 
commands may not work as anticipated.
The debugger works better if you configure your application to use a 
main()
module. Most of the 
examples in this book don’t use a 
main()
function for the sake of simplicity, but you should use one 
for any production code you create. The 
ShowFilters2.py
file contains the modifications to provide 
548592c12.indd 256
2/24/10 12:48:48 PM
www.finebook.ir


Debugging with the Python Debugger

Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   265   266   267   268   269   270   271   272   ...   453




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish