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
13bfbe77
Kaydet (Commit)
13bfbe77
authored
Eyl 25, 1996
tarafından
Jack Jansen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed PM debugging
Added different arrow-icons for running/calling/returning/exception
üst
5c303888
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
7 deletions
+40
-7
TwitCore.py
Mac/Tools/twit/TwitCore.py
+35
-4
mac_widgets.py
Mac/Tools/twit/mac_widgets.py
+4
-3
mactwit_app.py
Mac/Tools/twit/mactwit_app.py
+1
-0
twit.rsrc.hqx
Mac/Tools/twit/twit.rsrc.hqx
+0
-0
No files found.
Mac/Tools/twit/TwitCore.py
Dosyayı görüntüle @
13bfbe77
...
...
@@ -13,6 +13,13 @@ SIMPLE_TYPES=(
types
.
StringType
)
# XXXX Mac-specific
ICON_NORMAL
=
512
ICON_RETURN
=
515
ICON_CALL
=
516
ICON_ZERO
=
517
ICON_DEAD
=
518
def
Initialize
():
pass
...
...
@@ -23,6 +30,7 @@ class DebuggerStuff(bdb.Bdb):
self
.
parent
=
parent
self
.
exception_info
=
(
None
,
None
)
self
.
reason
=
'Not running'
self
.
icon
=
ICON_NORMAL
self
.
reset
()
def
reset
(
self
):
...
...
@@ -30,6 +38,7 @@ class DebuggerStuff(bdb.Bdb):
self
.
forget
()
def
forget
(
self
):
print
'FORGET'
self
.
lineno
=
None
self
.
stack
=
[]
self
.
curindex
=
0
...
...
@@ -37,6 +46,7 @@ class DebuggerStuff(bdb.Bdb):
def
setup
(
self
,
f
,
t
):
self
.
forget
()
print
'SETUP'
,
f
,
t
self
.
stack
,
self
.
curindex
=
self
.
get_stack
(
f
,
t
)
self
.
curframe
=
self
.
stack
[
self
.
curindex
][
0
]
...
...
@@ -46,19 +56,23 @@ class DebuggerStuff(bdb.Bdb):
self
.
exception_info
=
(
None
,
None
)
def
user_call
(
self
,
frame
,
argument_list
):
self
.
reason
=
'Calling function'
self
.
reason
=
'Calling'
self
.
icon
=
ICON_CALL
self
.
interaction
(
frame
,
None
)
def
user_line
(
self
,
frame
):
self
.
reason
=
'Stopped'
self
.
icon
=
ICON_NORMAL
self
.
interaction
(
frame
,
None
)
def
user_return
(
self
,
frame
,
return_value
):
self
.
reason
=
'Returning from function'
self
.
reason
=
'Returning'
self
.
icon
=
ICON_RETURN
self
.
interaction
(
frame
,
None
)
def
user_exception
(
self
,
frame
,
(
exc_type
,
exc_value
,
exc_traceback
)):
self
.
reason
=
'Exception occurred'
self
.
icon
=
ICON_DEAD
self
.
exception_info
=
(
exc_type
,
exc_value
)
self
.
interaction
(
frame
,
exc_traceback
)
...
...
@@ -71,6 +85,7 @@ class DebuggerStuff(bdb.Bdb):
return
tp
,
value
def
getstacktrace
(
self
):
print
'DBG GETSTACKTRACE'
,
self
.
stack
names
,
locations
=
[],
[]
for
frame
,
lineno
in
self
.
stack
:
name
=
frame
.
f_code
.
co_name
...
...
@@ -89,6 +104,7 @@ class DebuggerStuff(bdb.Bdb):
if
not
modname
:
modname
=
"<unknown>"
locations
.
append
(
"
%
s:
%
d"
%
(
modname
,
lineno
))
print
'DBG RETURNS'
,
names
,
locations
return
names
,
locations
def
getframe
(
self
,
number
):
...
...
@@ -128,11 +144,13 @@ class Application:
self
.
run_dialog
.
open
()
self
.
module_dialog
=
None
self
.
initial_cmd
=
None
self
.
cur_string_name
=
None
if
pm_args
:
while
pm_args
.
tb_next
<>
None
:
pm_args
=
pm_args
.
tb_next
self
.
dbg
.
setup
(
pm_args
.
tb_frame
,
pm_args
)
self
.
run_dialog
.
setsession_pm
()
self
.
run_dialog
.
update_views
()
elif
run_args
:
self
.
run_dialog
.
setsession_run
()
self
.
initial_cmd
=
run_args
...
...
@@ -164,6 +182,12 @@ class Application:
def
run
(
self
):
cmd
=
AskString
(
'Statement to execute:'
)
self
.
cur_string_name
=
'<string: "
%
s">'
%
cmd
try
:
cmd
=
compile
(
cmd
,
self
.
cur_string_name
,
'exec'
)
except
SyntaxError
,
arg
:
ShowMessage
(
'Syntax error:
%
s'
%
`arg`
)
return
self
.
initial_cmd
=
(
cmd
,
None
,
None
)
self
.
run_dialog
.
setsession_run
()
self
.
exit_mainloop
()
...
...
@@ -247,12 +271,19 @@ class StackBrowser:
self
.
cur_line
=
optnextline
if
self
.
cur_source
==
'<string>'
:
self
.
cur_source
=
None
msg
=
"Executing from <string>"
msg
=
"Executing from unknown <string>"
elif
type
(
self
.
cur_source
)
==
types
.
StringType
and
\
self
.
cur_source
[:
8
]
==
'<string:'
:
msg
=
"Executing from "
+
self
.
cur_source
self
.
cur_source
=
None
print
'SOURCE'
,
self
.
cur_source
print
'LINE'
,
self
.
cur_line
self
.
setsource
(
msg
)
self
.
source
.
setcurline
(
self
.
cur_line
)
if
not
self
.
cur_line
:
self
.
source
.
setcurline
(
1
,
ICON_ZERO
)
else
:
self
.
source
.
setcurline
(
self
.
cur_line
,
self
.
parent
.
dbg
.
icon
)
self
.
breaks_changed
(
self
.
cur_source
)
...
...
Mac/Tools/twit/mac_widgets.py
Dosyayı görüntüle @
13bfbe77
...
...
@@ -14,7 +14,6 @@ MARGIN=2
ICONSIZE
=
16
TEXTWIDTH
=
4096
# More-or-less random value
PIC_CURRENT
=
512
PIC_BREAK
=
513
picture_cache
=
{}
...
...
@@ -179,14 +178,16 @@ class MT_IconTextWidget(MT_TextWidget):
self
.
terect
[
0
]
-
1
,
self
.
terect
[
3
]
-
1
)
self
.
curlinerange
=
(
self
.
terect
[
1
]
+
self
.
ted
.
lineHeight
,
self
.
terect
[
3
]
-
2
*
self
.
ted
.
lineHeight
)
self
.
piccurrent
=
512
def
setbreaks
(
self
,
list
):
self
.
breakpointlist
=
list
[:]
Qd
.
SetPort
(
self
.
wid
)
Win
.
InvalRect
(
self
.
iconrect
)
def
setcurline
(
self
,
line
):
def
setcurline
(
self
,
line
,
pic
=
512
):
self
.
curline
=
line
self
.
piccurrent
=
pic
Qd
.
SetPort
(
self
.
wid
)
self
.
showline
(
line
)
...
...
@@ -224,7 +225,7 @@ class MT_IconTextWidget(MT_TextWidget):
if
topline
<=
i
<=
botline
:
self
.
draw1icon
(
i
,
PIC_BREAK
)
if
self
.
curline
<>
None
and
topline
<=
self
.
curline
<=
botline
:
self
.
draw1icon
(
self
.
curline
,
PIC_CURRENT
)
self
.
draw1icon
(
self
.
curline
,
self
.
piccurrent
)
def
draw1icon
(
self
,
line
,
which
):
offset
=
self
.
line_index
[
line
]
...
...
Mac/Tools/twit/mactwit_app.py
Dosyayı görüntüle @
13bfbe77
...
...
@@ -18,6 +18,7 @@ _watch = Qd.GetCursor(4).data
# Made available to TwitCore:
AskString
=
EasyDialogs
.
AskString
ShowMessage
=
EasyDialogs
.
Message
def
SetCursor
():
Qd
.
SetCursor
(
_arrow
)
...
...
Mac/Tools/twit/twit.rsrc.hqx
Dosyayı görüntüle @
13bfbe77
This diff is collapsed.
Click to expand it.
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