Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
5e38b6fd
Kaydet (Commit)
5e38b6fd
authored
Şub 27, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
handle class exceptions; added runeval; made runctx obsolete
üst
051ab123
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
88 additions
and
29 deletions
+88
-29
bdb.py
Lib/bdb.py
+30
-7
wdb.py
Lib/lib-stdwin/wdb.py
+13
-6
wdbframewin.py
Lib/lib-stdwin/wdbframewin.py
+4
-1
pdb.py
Lib/pdb.py
+24
-8
wdb.py
Lib/stdwin/wdb.py
+13
-6
wdbframewin.py
Lib/stdwin/wdbframewin.py
+4
-1
No files found.
Lib/bdb.py
Dosyayı görüntüle @
5e38b6fd
...
@@ -270,36 +270,59 @@ class Bdb: # Basic Debugger
...
@@ -270,36 +270,59 @@ class Bdb: # Basic Debugger
# The following two methods can be called by clients to use
# The following two methods can be called by clients to use
# a debugger to debug a statement, given as a string.
# a debugger to debug a statement, given as a string.
def
run
(
self
,
cmd
):
def
run
(
self
,
cmd
,
globals
=
None
,
locals
=
None
):
import
__main__
if
globals
is
None
:
dict
=
__main__
.
__dict__
import
__main__
self
.
runctx
(
cmd
,
dict
,
dict
)
globals
=
__main__
.
__dict__
if
locals
is
None
:
locals
=
globals
self
.
reset
()
sys
.
settrace
(
self
.
trace_dispatch
)
try
:
try
:
exec
cmd
+
'
\n
'
in
globals
,
locals
except
BdbQuit
:
pass
finally
:
self
.
quitting
=
1
sys
.
settrace
(
None
)
def
runctx
(
self
,
cmd
,
globals
,
locals
):
def
runeval
(
self
,
expr
,
globals
=
None
,
locals
=
None
):
if
globals
is
None
:
import
__main__
globals
=
__main__
.
__dict__
if
locals
is
None
:
locals
=
globals
self
.
reset
()
self
.
reset
()
sys
.
settrace
(
self
.
trace_dispatch
)
sys
.
settrace
(
self
.
trace_dispatch
)
try
:
try
:
try
:
try
:
exec
(
cmd
+
'
\n
'
,
globals
,
locals
)
return
eval
(
expr
+
'
\n
'
,
globals
,
locals
)
except
BdbQuit
:
except
BdbQuit
:
pass
pass
finally
:
finally
:
self
.
quitting
=
1
self
.
quitting
=
1
sys
.
settrace
(
None
)
sys
.
settrace
(
None
)
def
runctx
(
self
,
cmd
,
globals
,
locals
):
# B/W compatibility
self
.
run
(
cmd
,
globals
,
locals
)
# This method is more useful to debug a single function call.
# This method is more useful to debug a single function call.
def
runcall
(
self
,
func
,
*
args
):
def
runcall
(
self
,
func
,
*
args
):
self
.
reset
()
self
.
reset
()
sys
.
settrace
(
self
.
trace_dispatch
)
sys
.
settrace
(
self
.
trace_dispatch
)
res
=
None
try
:
try
:
try
:
try
:
apply
(
func
,
args
)
res
=
apply
(
func
,
args
)
except
BdbQuit
:
except
BdbQuit
:
pass
pass
finally
:
finally
:
self
.
quitting
=
1
self
.
quitting
=
1
sys
.
settrace
(
None
)
sys
.
settrace
(
None
)
return
res
def
set_trace
():
def
set_trace
():
...
...
Lib/lib-stdwin/wdb.py
Dosyayı görüntüle @
5e38b6fd
...
@@ -75,7 +75,10 @@ class Wdb(bdb.Bdb, basewin.BaseWindow): # Window debugger
...
@@ -75,7 +75,10 @@ class Wdb(bdb.Bdb, basewin.BaseWindow): # Window debugger
# This function is called if an exception occurs,
# This function is called if an exception occurs,
# but only if we are to stop at or just below this level
# but only if we are to stop at or just below this level
frame
.
f_locals
[
'__exception__'
]
=
exc_type
,
exc_value
frame
.
f_locals
[
'__exception__'
]
=
exc_type
,
exc_value
self
.
settitle
(
exc_type
+
': '
+
repr
.
repr
(
exc_value
))
if
type
(
exc_type
)
==
type
(
''
):
exc_type_name
=
exc_type
else
:
exc_type_name
=
exc_type
.
__name__
self
.
settitle
(
exc_type_name
+
': '
+
repr
.
repr
(
exc_value
))
stdwin
.
fleep
()
stdwin
.
fleep
()
self
.
interaction
(
frame
,
exc_traceback
)
self
.
interaction
(
frame
,
exc_traceback
)
if
not
self
.
closed
:
if
not
self
.
closed
:
...
@@ -271,19 +274,23 @@ class Wdb(bdb.Bdb, basewin.BaseWindow): # Window debugger
...
@@ -271,19 +274,23 @@ class Wdb(bdb.Bdb, basewin.BaseWindow): # Window debugger
# Simplified interface
# Simplified interface
def
run
(
statement
):
def
run
(
statement
,
globals
=
None
,
locals
=
None
):
x
=
Wdb
()
x
=
Wdb
()
try
:
x
.
run
(
statement
)
try
:
x
.
run
(
statement
,
globals
,
locals
)
finally
:
x
.
close
()
finally
:
x
.
close
()
def
run
ctx
(
statement
,
globals
,
locals
):
def
run
eval
(
expression
,
globals
=
None
,
locals
=
None
):
x
=
Wdb
()
x
=
Wdb
()
try
:
x
.
runctx
(
statement
,
globals
,
locals
)
try
:
return
x
.
runeval
(
expression
,
globals
,
locals
)
finally
:
x
.
close
()
finally
:
x
.
close
()
def
runctx
(
statement
,
globals
,
locals
):
# B/W compatibility
run
(
statement
,
globals
,
locals
)
def
runcall
(
*
args
):
def
runcall
(
*
args
):
x
=
Wdb
()
x
=
Wdb
()
try
:
apply
(
x
.
runcall
,
args
)
try
:
return
apply
(
x
.
runcall
,
args
)
finally
:
x
.
close
()
finally
:
x
.
close
()
def
set_trace
():
def
set_trace
():
...
...
Lib/lib-stdwin/wdbframewin.py
Dosyayı görüntüle @
5e38b6fd
...
@@ -100,7 +100,10 @@ class FrameWindow(basewin.BaseWindow):
...
@@ -100,7 +100,10 @@ class FrameWindow(basewin.BaseWindow):
value
=
eval
(
expr
,
globals
,
locals
)
value
=
eval
(
expr
,
globals
,
locals
)
output
=
repr
.
repr
(
value
)
output
=
repr
.
repr
(
value
)
except
:
except
:
output
=
sys
.
exc_type
+
': '
+
`sys.exc_value`
if
type
(
sys
.
exc_type
)
==
type
(
''
):
exc_type_name
=
sys
.
exc_type
else
:
exc_type_name
=
sys
.
exc_type
.
__name__
output
=
exc_type_name
+
': '
+
`sys.exc_value`
self
.
displaylist
[
1
]
=
output
self
.
displaylist
[
1
]
=
output
lh
=
stdwin
.
lineheight
()
lh
=
stdwin
.
lineheight
()
r
=
(
-
10
,
0
),
(
30000
,
2
*
lh
)
r
=
(
-
10
,
0
),
(
30000
,
2
*
lh
)
...
...
Lib/pdb.py
Dosyayı görüntüle @
5e38b6fd
...
@@ -55,7 +55,10 @@ class Pdb(bdb.Bdb, cmd.Cmd):
...
@@ -55,7 +55,10 @@ class Pdb(bdb.Bdb, cmd.Cmd):
# This function is called if an exception occurs,
# This function is called if an exception occurs,
# but only if we are to stop at or just below this level
# but only if we are to stop at or just below this level
frame
.
f_locals
[
'__exception__'
]
=
exc_type
,
exc_value
frame
.
f_locals
[
'__exception__'
]
=
exc_type
,
exc_value
print
exc_type
+
':'
,
repr
.
repr
(
exc_value
)
if
type
(
exc_type
)
==
type
(
''
):
exc_type_name
=
exc_type
else
:
exc_type_name
=
exc_type
.
__name__
print
exc_type_name
+
':'
,
repr
.
repr
(
exc_value
)
self
.
interaction
(
frame
,
exc_traceback
)
self
.
interaction
(
frame
,
exc_traceback
)
# General interaction function
# General interaction function
...
@@ -74,7 +77,10 @@ class Pdb(bdb.Bdb, cmd.Cmd):
...
@@ -74,7 +77,10 @@ class Pdb(bdb.Bdb, cmd.Cmd):
try
:
try
:
exec
(
line
+
'
\n
'
,
globals
,
locals
)
exec
(
line
+
'
\n
'
,
globals
,
locals
)
except
:
except
:
print
'***'
,
sys
.
exc_type
+
':'
,
sys
.
exc_value
if
type
(
sys
.
exc_type
)
==
type
(
''
):
exc_type_name
=
sys
.
exc_type
else
:
exc_type_name
=
sys
.
exc_type
.
__name__
print
'***'
,
exc_type_name
+
':'
,
sys
.
exc_value
# Command definitions, called by cmdloop()
# Command definitions, called by cmdloop()
# The argument is the remaining string on the command line
# The argument is the remaining string on the command line
...
@@ -199,7 +205,10 @@ class Pdb(bdb.Bdb, cmd.Cmd):
...
@@ -199,7 +205,10 @@ class Pdb(bdb.Bdb, cmd.Cmd):
value
=
eval
(
arg
,
self
.
curframe
.
f_globals
,
\
value
=
eval
(
arg
,
self
.
curframe
.
f_globals
,
\
self
.
curframe
.
f_locals
)
self
.
curframe
.
f_locals
)
except
:
except
:
print
'***'
,
sys
.
exc_type
+
':'
,
`sys.exc_value`
if
type
(
sys
.
exc_type
)
==
type
(
''
):
exc_type_name
=
sys
.
exc_type
else
:
exc_type_name
=
sys
.
exc_type
.
__name__
print
'***'
,
exc_type_name
+
':'
,
`sys.exc_value`
return
return
print
`value`
print
`value`
...
@@ -254,7 +263,10 @@ class Pdb(bdb.Bdb, cmd.Cmd):
...
@@ -254,7 +263,10 @@ class Pdb(bdb.Bdb, cmd.Cmd):
value
=
eval
(
arg
,
self
.
curframe
.
f_globals
,
\
value
=
eval
(
arg
,
self
.
curframe
.
f_globals
,
\
self
.
curframe
.
f_locals
)
self
.
curframe
.
f_locals
)
except
:
except
:
print
'***'
,
sys
.
exc_type
+
':'
,
`sys.exc_value`
if
type
(
sys
.
exc_type
)
==
type
(
''
):
exc_type_name
=
sys
.
exc_type
else
:
exc_type_name
=
sys
.
exc_type
.
__name__
print
'***'
,
exc_type_name
+
':'
,
`sys.exc_value`
return
return
code
=
None
code
=
None
# Is it a function?
# Is it a function?
...
@@ -429,14 +441,18 @@ class Pdb(bdb.Bdb, cmd.Cmd):
...
@@ -429,14 +441,18 @@ class Pdb(bdb.Bdb, cmd.Cmd):
# Simplified interface
# Simplified interface
def
run
(
statement
):
def
run
(
statement
,
globals
=
None
,
locals
=
None
):
Pdb
()
.
run
(
statement
)
Pdb
()
.
run
(
statement
,
globals
,
locals
)
def
runeval
(
expression
,
globals
=
None
,
locals
=
None
):
return
Pdb
()
.
runeval
(
expression
,
globals
,
locals
)
def
runctx
(
statement
,
globals
,
locals
):
def
runctx
(
statement
,
globals
,
locals
):
Pdb
()
.
runctx
(
statement
,
globals
,
locals
)
# B/W compatibility
run
(
statement
,
globals
,
locals
)
def
runcall
(
*
args
):
def
runcall
(
*
args
):
apply
(
Pdb
()
.
runcall
,
args
)
return
apply
(
Pdb
()
.
runcall
,
args
)
def
set_trace
():
def
set_trace
():
Pdb
()
.
set_trace
()
Pdb
()
.
set_trace
()
...
...
Lib/stdwin/wdb.py
Dosyayı görüntüle @
5e38b6fd
...
@@ -75,7 +75,10 @@ class Wdb(bdb.Bdb, basewin.BaseWindow): # Window debugger
...
@@ -75,7 +75,10 @@ class Wdb(bdb.Bdb, basewin.BaseWindow): # Window debugger
# This function is called if an exception occurs,
# This function is called if an exception occurs,
# but only if we are to stop at or just below this level
# but only if we are to stop at or just below this level
frame
.
f_locals
[
'__exception__'
]
=
exc_type
,
exc_value
frame
.
f_locals
[
'__exception__'
]
=
exc_type
,
exc_value
self
.
settitle
(
exc_type
+
': '
+
repr
.
repr
(
exc_value
))
if
type
(
exc_type
)
==
type
(
''
):
exc_type_name
=
exc_type
else
:
exc_type_name
=
exc_type
.
__name__
self
.
settitle
(
exc_type_name
+
': '
+
repr
.
repr
(
exc_value
))
stdwin
.
fleep
()
stdwin
.
fleep
()
self
.
interaction
(
frame
,
exc_traceback
)
self
.
interaction
(
frame
,
exc_traceback
)
if
not
self
.
closed
:
if
not
self
.
closed
:
...
@@ -271,19 +274,23 @@ class Wdb(bdb.Bdb, basewin.BaseWindow): # Window debugger
...
@@ -271,19 +274,23 @@ class Wdb(bdb.Bdb, basewin.BaseWindow): # Window debugger
# Simplified interface
# Simplified interface
def
run
(
statement
):
def
run
(
statement
,
globals
=
None
,
locals
=
None
):
x
=
Wdb
()
x
=
Wdb
()
try
:
x
.
run
(
statement
)
try
:
x
.
run
(
statement
,
globals
,
locals
)
finally
:
x
.
close
()
finally
:
x
.
close
()
def
run
ctx
(
statement
,
globals
,
locals
):
def
run
eval
(
expression
,
globals
=
None
,
locals
=
None
):
x
=
Wdb
()
x
=
Wdb
()
try
:
x
.
runctx
(
statement
,
globals
,
locals
)
try
:
return
x
.
runeval
(
expression
,
globals
,
locals
)
finally
:
x
.
close
()
finally
:
x
.
close
()
def
runctx
(
statement
,
globals
,
locals
):
# B/W compatibility
run
(
statement
,
globals
,
locals
)
def
runcall
(
*
args
):
def
runcall
(
*
args
):
x
=
Wdb
()
x
=
Wdb
()
try
:
apply
(
x
.
runcall
,
args
)
try
:
return
apply
(
x
.
runcall
,
args
)
finally
:
x
.
close
()
finally
:
x
.
close
()
def
set_trace
():
def
set_trace
():
...
...
Lib/stdwin/wdbframewin.py
Dosyayı görüntüle @
5e38b6fd
...
@@ -100,7 +100,10 @@ class FrameWindow(basewin.BaseWindow):
...
@@ -100,7 +100,10 @@ class FrameWindow(basewin.BaseWindow):
value
=
eval
(
expr
,
globals
,
locals
)
value
=
eval
(
expr
,
globals
,
locals
)
output
=
repr
.
repr
(
value
)
output
=
repr
.
repr
(
value
)
except
:
except
:
output
=
sys
.
exc_type
+
': '
+
`sys.exc_value`
if
type
(
sys
.
exc_type
)
==
type
(
''
):
exc_type_name
=
sys
.
exc_type
else
:
exc_type_name
=
sys
.
exc_type
.
__name__
output
=
exc_type_name
+
': '
+
`sys.exc_value`
self
.
displaylist
[
1
]
=
output
self
.
displaylist
[
1
]
=
output
lh
=
stdwin
.
lineheight
()
lh
=
stdwin
.
lineheight
()
r
=
(
-
10
,
0
),
(
30000
,
2
*
lh
)
r
=
(
-
10
,
0
),
(
30000
,
2
*
lh
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment